Skip to content

ASCII

ASCII, the acronym for the "American Standard Code for Information Interchange," is the first character-encoding scheme used between computers on the Internet.

Modern character encoding schemes like UTF-8 and ISO-8859 are backward-compatible with ASCII.

The ASCII Character Set

The ASCII character set was designed in the 1960s as a standard for computers and hardware devices, such as printers and tape drives.

Originally, ASCII was based on the English alphabet. It is a 7-bit character set containing 128 characters: the numbers 0–9, uppercase and lowercase English letters A–Z, basic punctuation symbols, and special characters.

Most character sets used in modern computers, HTML, and the Internet are backward-compatible with ASCII.

Below is a table listing the 128 ASCII characters and their equivalent HTML entity codes.

ASCII Printable Characters

ASCII CharacterHTML Entity CodeDescription
space
!!exclamation mark
""quotation mark
##number sign
$$dollar sign
%%percent sign
&&ampersand
''apostrophe
((left parenthesis
))right parenthesis
**asterisk
++plus sign
,,comma
--hyphen
..period
//slash
00digit 0
11digit 1
22digit 2
33digit 3
44digit 4
55digit 5
66digit 6
77digit 7
88digit 8
99digit 9
::colon
;;semicolon
<<less-than
==equals-to
>>greater-than
??question mark
@@at sign
AAuppercase A
BBuppercase B
CCuppercase C
DDuppercase D
EEuppercase E
FFuppercase F
GGuppercase G
HHuppercase H
IIuppercase I
JJuppercase J
KKuppercase K
LLuppercase L
MMuppercase M
NNuppercase N
OOuppercase O
PPuppercase P
QQuppercase Q
RRuppercase R
SSuppercase S
TTuppercase T
UUuppercase U
VVuppercase V
WWuppercase W
XXuppercase X
YYuppercase Y
ZZuppercase Z
[[left square bracket
\\backslash
]]right square bracket
^^caret
__underscore
``grave accent
aalowercase a
bblowercase b
cclowercase c
ddlowercase d
eelowercase e
fflowercase f
gglowercase g
hhlowercase h
iilowercase i
jjlowercase j
kklowercase k
lllowercase l
mmlowercase m
nnlowercase n
oolowercase o
pplowercase p
qqlowercase q
rrlowercase r
sslowercase s
ttlowercase t
uulowercase u
vvlowercase v
wwlowercase w
xxlowercase x
yylowercase y
zzlowercase z
{{left curly brace
||vertical bar
}}right curly brace
~~tilde

ASCII Device Control Characters

The ASCII device control characters (except horizontal tab, line feed, and carriage return) are rarely used in HTML documents. Originally, ASCII control characters (range 00–31, plus 127) were designed to control hardware devices.

ASCII CharacterHTML Entity CodeDescription
NULnull character
SOHstart of header
STXstart of text
ETXend of text
EOTend of transmission
ENQenquiry
ACKacknowledge
BELbell (ring)
BSbackspace
HThorizontal tab
LFline feed
VTvertical tab
FFform feed
CRcarriage return
SOshift out
SIshift in
DLEdata link escape
DC1device control 1
DC2device control 2
DC3device control 3
DC4device control 4
NAKnegative acknowledge
SYNsynchronize
ETBend transmission block
CANcancel
EMend of medium
SUBsubstitute
ESCescape
FSfile separator
GSgroup separator
RSrecord separator
USunit separator
DELdelete (rubout)

Practical Usage Example

You can insert these characters into HTML using either numeric or named references. Named entities are often preferred for readability:

html
<!-- Numeric reference -->
<p>&#38; displays as &amp;</p>

<!-- Named reference -->
<p>&amp; also displays as &amp;</p>

Practice

What are the uses of ASCII in HTML?

Dual-run preview — compare with live Symfony routes.