Beetwise

ASCII table

ASCII maps the codes 0 to 127 to characters.

The codes 0 to 31 are control codes. The codes 32 to 126 are printable. The code 127 is delete.

Each code fits in 7 bits, so a byte holds one ASCII character with the top bit clear.

Try the ASCII table in the bit editor

The code 65, which is the character A. Edit the expression or select a bit to flip it.

7
6
5
4
3
2
1
0
A
text · 8 bits
value
65
hex
0x41

Every printable ASCII code

Every printable ASCII code
CharacterDecimalHexBinary
space320x2000100000
!330x2100100001
"340x2200100010
#350x2300100011
$360x2400100100
%370x2500100101
&380x2600100110
'390x2700100111
(400x2800101000
)410x2900101001
*420x2A00101010
+430x2B00101011
,440x2C00101100
-450x2D00101101
.460x2E00101110
/470x2F00101111
0480x3000110000
1490x3100110001
2500x3200110010
3510x3300110011
4520x3400110100
5530x3500110101
6540x3600110110
7550x3700110111
8560x3800111000
9570x3900111001
:580x3A00111010
;590x3B00111011
<600x3C00111100
=610x3D00111101
>620x3E00111110
?630x3F00111111
@640x4001000000
A650x4101000001
B660x4201000010
C670x4301000011
D680x4401000100
E690x4501000101
F700x4601000110
G710x4701000111
H720x4801001000
I730x4901001001
J740x4A01001010
K750x4B01001011
L760x4C01001100
M770x4D01001101
N780x4E01001110
O790x4F01001111
P800x5001010000
Q810x5101010001
R820x5201010010
S830x5301010011
T840x5401010100
U850x5501010101
V860x5601010110
W870x5701010111
X880x5801011000
Y890x5901011001
Z900x5A01011010
[910x5B01011011
\920x5C01011100
]930x5D01011101
^940x5E01011110
_950x5F01011111
`960x6001100000
a970x6101100001
b980x6201100010
c990x6301100011
d1000x6401100100
e1010x6501100101
f1020x6601100110
g1030x6701100111
h1040x6801101000
i1050x6901101001
j1060x6A01101010
k1070x6B01101011
l1080x6C01101100
m1090x6D01101101
n1100x6E01101110
o1110x6F01101111
p1120x7001110000
q1130x7101110001
r1140x7201110010
s1150x7301110011
t1160x7401110100
u1170x7501110101
v1180x7601110110
w1190x7701110111
x1200x7801111000
y1210x7901111001
z1220x7A01111010
{1230x7B01111011
|1240x7C01111100
}1250x7D01111101
~1260x7E01111110

Where the ASCII table is used

A terminal, a serial monitor and a text file all agree on these codes.

A protocol that sends a command as text depends on the exact code of each letter.

Every later code set keeps these 128 codes. UTF-8 keeps them too.

The ASCII table: points to note

  • The blocks are not adjacent. The digits start at 48, the capitals at 65, and the small letters at 97.
  • The gap between a capital letter and its small form is 32, which is one bit: bit 5.
  • The code 0 is not the digit 0. The code 0 is a null character.
  • A code above 127 is outside ASCII. Do not assume a single byte holds one character.

The full bit editor

The full editor holds many values, evaluates expressions across them, and reads live values from a serial port.

Open this value in the full editor

Questions about the ASCII table

How many characters does ASCII hold?
ASCII holds 128 codes, from 0 to 127. Of those, 95 are printable.
What is the ASCII code of a space?
A space has the code 32, which is 0x20 and 00100000.
How do I convert a capital letter to a small letter with a bitwise operation?
Apply OR with 0x20 to get the small letter, and AND with 0xDF to get the capital letter.