ASCII Character Set and HTML Codes
ASCII stands for the American Standard Code for Information Interchange. ASCII was the first character set (encoding standard) used between computers on the Internet.
Both ISO-8859-1 (default in HTML 4.01) and UTF-8 (default in HTML5), are built on ASCII. The character encoding for the early web was ASCII.
Binary Information
Computer information (numbers, texts and pictures) is stored as binary ones and zeros (01000101). To standardize the storing of alphanumeric characters, the American Standard Code for Information Interchange (ASCII) was created. It defined a unique binary 7-bits number for each character.
Number of Characters in ASCII
27 = 128 (0 to 127)
ASCII is a 7-bit character set containing 128 characters. It contains control characters, numbers from 0 to 9, upper and lower case English letters from A to Z, and some special characters, punctuation and symbols.
Since ASCII used one byte (7 bits for the character and one bit for transmission parity control), it could only represent 128 different characters. In addition, 32 of these characters were reserved for other control purposes. The biggest weakness with ASCII was that it excluded non-English letters.
- 0 to 31 and 127: Control Characters
- 32 to 47: Special Characters
- 48 to 57: Numbers
- 58 to 64: Special Characters
- 65 to 90: Uppercase Alphabets
- 91 to 96: Special Characters
- 97 to 125: Lowercase Alphabets
- 126: Special Character
ASCII Printable Characters (32 - 126)
ASCII Characters | Description | HTML Entity Codes |
---|---|---|
space |   | |
! | exclamation mark | ! |
" | quotation mark | " |
# | number sign | # |
$ | dollar sign | $ |
% | percent sign | % |
& | ampersand | & |
' | apostrophe | ' |
( | left parenthesis | ( |
) | right parenthesis | ) |
* | asterisk | * |
+ | plus sign | + |
, | comma | , |
- | hyphen | - |
. | period | . |
/ | slash | / |
0 | digit 0 | 0 |
1 | digit 1 | 1 |
2 | digit 2 | 2 |
3 | digit 3 | 3 |
4 | digit 4 | 4 |
5 | digit 5 | 5 |
6 | digit 6 | 6 |
7 | digit 7 | 7 |
8 | digit 8 | 8 |
9 | digit 9 | 9 |
: | colon | : |
; | semicolon | ; |
< | less-than | < |
= | equals-to | = |
> | greater-than | > |
? | question mark | ? |
@ | at sign | @ |
A | uppercase A | A |
B | uppercase B | B |
C | uppercase C | C |
D | uppercase D | D |
E | uppercase E | E |
F | uppercase F | F |
G | uppercase G | G |
H | uppercase H | H |
I | uppercase I | I |
J | uppercase J | J |
K | uppercase K | K |
L | uppercase L | L |
M | uppercase M | M |
N | uppercase N | N |
O | uppercase O | O |
P | uppercase P | P |
Q | uppercase Q | Q |
R | uppercase R | R |
S | uppercase S | S |
T | uppercase T | T |
U | uppercase U | U |
V | uppercase V | V |
W | uppercase W | W |
X | uppercase X | X |
Y | uppercase Y | Y |
Z | uppercase Z | Z |
[ | left square bracket | [ |
\ | backslash | \ |
] | right square bracket | ] |
^ | caret | ^ |
_ | underscore | _ |
` | grave accent | ` |
a | lowercase a | a |
b | lowercase b | b |
c | lowercase c | c |
d | lowercase d | d |
e | lowercase e | e |
f | lowercase f | f |
g | lowercase g | g |
h | lowercase h | h |
i | lowercase i | i |
j | lowercase j | j |
k | lowercase k | k |
l | lowercase l | l |
m | lowercase m | m |
n | lowercase n | n |
o | lowercase o | o |
p | lowercase p | p |
q | lowercase q | q |
r | lowercase r | r |
s | lowercase s | s |
t | lowercase t | t |
u | lowercase u | u |
v | lowercase v | v |
w | lowercase w | w |
x | lowercase x | x |
y | lowercase y | y |
z | lowercase z | z |
{ | left curly brace | { |
| | vertical bar | | |
} | right curly brace | } |
~ | tilde | ~ |
Control Characters (0 - 31)
ASCII reserves the first 32 codes for control characters. These are codes intended to control peripheral devices (such as printers), or to provide meta-information about data streams. These code points do not represent printable characters.
ASCII Characters | Description | HTML Entity Codes |
---|---|---|
NUL | null character | � |
SOH | start of header |  |
STX | start of text |  |
ETX | end of text |  |
EOT | end of transmission |  |
ENQ | enquiry |  |
ACK | acknowledge |  |
BEL | bell (ring) |  |
BS | backspace |  |
HT | horizontal tab | 	 |
LF | line feed | |
VT | vertical tab |  |
FF | form feed |  |
CR | carriage return | |
SO | shift out |  |
SI | shift in |  |
DLE | data link escape |  |
DC1 | device control 1 |  |
DC2 | device control 2 |  |
DC3 | device control 3 |  |
DC4 | device control 4 |  |
NAK | negative acknowledge |  |
SYN | synchronize |  |
ETB | end transmission block |  |
CAN | cancel |  |
EM | end of medium |  |
SUB | substitute |  |
ESC | escape |  |
FS | file separator |  |
GS | group separator |  |
RS | record separator |  |
US | unit separator |  |
DEL | delete (rubout) |  |
Extended ASCII (128 - 255)
Extended ASCII character encoding are 8-bit encoding that include the standard seven-bit ASCII characters, plus additional characters.