ASCII Table

Date: , Updated: — by Slatian

This ASCII-Table is mostly derived from the Unicode 15.0 Documentation.

Table of Contents

Mostly Printable Characters

Skip to the control characters table

Codes 0x20 to 0x7E are referred to as the printable characters, 0x7F is a control character. Wikipedia has more background information.

Numbers and Specials
CharHexDec
SPACE2032
!2133
"2234
#2335
$2436
%2537
&2638
'2739
(2840
)2941
*2a42
+2b43
,2c44
-2d45
.2e46
/2f47
03048
13149
23250
33351
43452
53553
63654
73755
83856
93957
:3a58
;3b59
<3c60
=3d61
>3e62
?3f63
Uppercase
CharHexDec
@4064
A4165
B4266
C4367
D4468
E4569
F4670
G4771
H4872
I4973
J4a74
K4b75
L4c76
M4d77
N4e78
O4f79
P5080
Q5181
R5282
S5383
T5484
U5585
V5686
W5787
X5888
Y5989
Z5a90
[5b91
\5c92
]5d93
^5e94
_5f95
Lowercase
CharHexDec
`6096
a6197
b6298
c6399
d64100
e65101
f66102
g67103
h68104
i69105
j6a106
k6b107
l6c108
m6d109
n6e110
o6f111
p70112
q71113
r72114
s73115
t74116
u75117
v76118
w77119
x78120
y79121
z7a122
{7b123
|7c124
}7d125
~7e126
DEL7f127

Note on the DEL code:The DEL being 0x7F, meaning it has all 7 bits set, probably originates from how one "deleted" something from paper tape, by just punching all of the holes one could "erase" the original character. Its meaning is ambigious, but it usually refers to a backspace.

Fun Fact: The lowercase characters in ASCII were an "aftertought" and only added later in 1965, two years after the initial release.

Control characters

CharHexOctDecNameC Esc
NUL000000Null
SOH010011Start Of Heading
STX020022Start Of Text
ETX030033End Of Text
EOT040044End Of Transmission
ENQ050055Enquiry
ACK060066Acknowledge
BEL070077Bell / Alert\a
BS080108BAckspace
HT090119HOrizontal Tab\t
LF0a01210Line Feed\n
VT0b01311Vertical Tab\v
FF0c01412Form Feed\f
CR0d01513Carriage Return\r
SO0e01614Shift Out
SI0f01715Shift In
DLE1002016Data Link Escape
DC11102117Device Control 1
DC21202218Device Control 2
DC31302319Device Control 3
DC41402420Device Control 4
NAK1502521Negative Acknowledge
SYN1602622Synchronous Idle
ETB1702723End Of Transmission Block
CAN1803024Cancel
EM1903125End Of Medium
SUB1a03226Substitute
ESC1b03327Escape\e
FS1c03428File Seperator
GS1d03529Group Seperator
RS1e03630Record Seperator
US1f03731Unit Seperator

Note: The Names have been titlecased to make them easier to read.

Notation

Escaping in Scripting and Programming

Sometimes in languages one can't use all the characters available in the source file, especially when using control characters. Encoding these as other characters is called escaping. This usually happens with text between double quotes ".

There are differences between languages and implementations but the general rules are:

Note: C Esc here is short C-Escape as the C language apparantly started this way of excaping characters in strings. It is now used by almost all modern languages and in other contexts. i.e. printf, sed, etc. exact support may vary.

Escaping in XML and HTML

XML and html have their own way of escaping non-printable characters, this involves a sequence sandwiched between an ampersand & and a semicolon ;.

In general Characters can be escaped using &#<dec>; where <dec> is replaced by the decimal value associted with the character. (i.e, &#38; to encode an ampersand &)

There are also named escapes to make remembering them easier:

CharacterXML-escape
&&amp;
<&lt;
>&gt;
"&quot;

Control and Shift

With the ASCII table control and shift keys an be implemented using simple addition and substraction.

The lowercase character can be obtained by adding 32 (0x20) to the code of the corresponding uppercase character and the control key goes 64 (0x40) in the opposite direction.

With that ctrl+c maps to code 3 "End of Text". And ctrl+d maps to "End of Transmission". You may know those shortcuts from the terminal, they hopefully make a bit more sense now.

Control characters are sometimes written down/printed as the character one gets when adding 64 to the control characters value prefixed by an ^.

This maps escape to ^] and the nullbyte to ^@. (You have probably seen those when opening a binary file in a text editor.)

Unicode

Creating a unicode table andkeeping it updated is out of scope here, besides that: Wikipedia has a List of Unicode Characters and there are the offical Unicode Character Code Charts. (Plus a whole lot of other unicode tables out there.)

Notation Hint: Unicode codepoints (that is the number assigned in the unicode standard, not the binary character representation) are written U+<hex> where <hex> is the codepint number in hexadecimal. Example: U+1f603 for 😃.

There is also a little commandline tool called uni, that is pretty good at providing a searchable unicode table.