ASCII is an acronym for American Standard Code for Information Interchange. Yeah, that doesn’t really tell us much about what an ASCII code is, or why we should care about an ASCII table.
For that, we need to remember that computers only understand numbers. And only binary numbers at that. When you press the A key on your keyboard, we need a way for your computer to know what key was pressed. And since it doesn’t understand letters, we have to use numbers.
If you scroll down on the ASCII table below and find the capital letter A you’ll see that it has an ASCII value of 65, which is 0100 0001 in binary. That number is sent from your keyboard to your computer and the computer interprets it as an A. The same thing happens in data files. It’s the number that’s ultimately needed, not the character.
And if you’d like a little more information on ASCII, head on over to Wikipedia.
Here you’ll find a list of the first 127 ASCII codes that your computer knows how to work with. We’re no longer limited to just 127, but when people talk about ASCII tables, this is usually the list they’re talking about.
You can probably skip over the first 31. They’re system codes that tell the computer how to do things, but don’t typically show up on screen. There are a few interesting ones in there though. For example, pressing the enter key on your keyboard sends the code 13.
Visible characters start at 32 with space. Okay, so I guess space really isn’t a visible character.
If you’re using this ASCII table for an intro to programming course you probably really only have to memorize 3 or 4 different numbers. The first one is space, which is code 32. Then you’ll want to remember lower case a (97), capital A (65) and zero (48). From there you can figure out the other letters and numbers. Since the letters and number are sequential you can work out the rest. For example, a lower case d is 100 – 3 characters after lower case a.
CHARACTER | DECIMAL | BINARY | OCTAL | HEX | |
---|---|---|---|---|---|
(null) | 0 | 0 | 0 | 0 | |
(start of heading) | 1 | 1 | 1 | 1 | |
(start of text) | 2 | 10 | 2 | 2 | |
(end of text) | 3 | 11 | 3 | 3 | |
(end of transmission) | 4 | 100 | 4 | 4 | |
(enquiry) | 5 | 101 | 5 | 5 | |
(acknowledge) | 6 | 110 | 6 | 6 | |
(bell) | 7 | 111 | 7 | 7 | |
(backspace) | 8 | 1000 | 10 | 8 | |
(horizontal tab) | 9 | 1001 | 11 | 9 | |
(new line) | 10 | 1010 | 12 | A | |
(vertical tab) | 11 | 1011 | 13 | B | |
(new page) | 12 | 1100 | 14 | C | |
(carriage return) | 13 | 1101 | 15 | D | |
(shift out) | 14 | 1110 | 16 | E | |
(shift in) | 15 | 1111 | 17 | F | |
(data link escape) | 16 | 10000 | 20 | 10 | |
(device control 1) | 17 | 10001 | 21 | 11 | |
(device control 2) | 18 | 10010 | 22 | 12 | |
(device control 3) | 19 | 10011 | 23 | 13 | |
(device control 4) | 20 | 10100 | 24 | 14 | |
(negative acknowledge) | 21 | 10101 | 25 | 15 | |
(synchronous idle) | 22 | 10110 | 26 | 16 | |
(end of trans block) | 23 | 10111 | 27 | 17 | |
(cancel) | 24 | 11000 | 30 | 18 | |
(end of medium) | 25 | 11001 | 31 | 19 | |
(substitute) | 26 | 11010 | 32 | 1A | |
(escape) | 27 | 11011 | 33 | 1B | |
(file separator) | 28 | 11100 | 34 | 1C | |
(group separator) | 29 | 11101 | 35 | 1D | |
(record separator) | 30 | 11110 | 36 | 1E | |
(unit separator) | 31 | 11111 | 37 | 1F | |
(SPACE) | 32 | 100000 | 40 | 20 | |
! | 33 | 100001 | 41 | 21 | |
” | 34 | 100010 | 42 | 22 | |
# | 35 | 100011 | 43 | 23 | |
$ | 36 | 100100 | 44 | 24 | |
% | 37 | 100101 | 45 | 25 | |
& | 38 | 100110 | 46 | 26 | |
‘ | 39 | 100111 | 47 | 27 | |
( | 40 | 101000 | 50 | 28 | |
) | 41 | 101001 | 51 | 29 | |
* | 42 | 101010 | 52 | 2A | |
+ | 43 | 101011 | 53 | 2B | |
, | 44 | 101100 | 54 | 2C | |
– | 45 | 101101 | 55 | 2D | |
. | 46 | 101110 | 56 | 2E | |
/ | 47 | 101111 | 57 | 2F | |
0 | 48 | 110000 | 60 | 30 | |
1 | 49 | 110001 | 61 | 31 | |
2 | 50 | 110010 | 62 | 32 | |
3 | 51 | 110011 | 63 | 33 | |
4 | 52 | 110100 | 64 | 34 | |
5 | 53 | 110101 | 65 | 35 | |
6 | 54 | 110110 | 66 | 36 | |
7 | 55 | 110111 | 67 | 37 | |
8 | 56 | 111000 | 70 | 38 | |
9 | 57 | 111001 | 71 | 39 | |
: | 58 | 111010 | 72 | 3A | |
; | 59 | 111011 | 73 | 3B | |
< | 60 | 111100 | 74 | 3C | |
= | 61 | 111101 | 75 | 3D | |
> | 62 | 111110 | 76 | 3E | |
? | 63 | 111111 | 77 | 3F | |
` | 64 | 1000000 | 100 | 40 | |
A | 65 | 1000001 | 101 | 41 | |
B | 66 | 1000010 | 102 | 42 | |
C | 67 | 1000011 | 103 | 43 | |
D | 68 | 1000100 | 104 | 44 | |
E | 69 | 1000101 | 105 | 45 | |
F | 70 | 1000110 | 106 | 46 | |
G | 71 | 1000111 | 107 | 47 | |
H | 72 | 1001000 | 110 | 48 | |
I | 73 | 1001001 | 111 | 49 | |
J | 74 | 1001010 | 112 | 4A | |
K | 75 | 1001011 | 113 | 4B | |
L | 76 | 1001100 | 114 | 4C | |
M | 77 | 1001101 | 115 | 4D | |
N | 78 | 1001110 | 116 | 4E | |
O | 79 | 1001111 | 117 | 4F | |
P | 80 | 1010000 | 120 | 50 | |
Q | 81 | 1010001 | 121 | 51 | |
R | 82 | 1010010 | 122 | 52 | |
S | 83 | 1010011 | 123 | 53 | |
T | 84 | 1010100 | 124 | 54 | |
U | 85 | 1010101 | 125 | 55 | |
V | 86 | 1010110 | 126 | 56 | |
W | 87 | 1010111 | 127 | 57 | |
X | 88 | 1011000 | 130 | 58 | |
Y | 89 | 1011001 | 131 | 59 | |
Z | 90 | 1011010 | 132 | 5A | |
[ | 91 | 1011011 | 133 | 5B | |
| | 92 | 1011100 | 134 | 5C | |
] | 93 | 1011101 | 135 | 5D | |
^ | 94 | 1011110 | 136 | 5E | |
_ | 95 | 1011111 | 137 | 5F | |
` | 96 | 1100000 | 140 | 60 | |
a | 97 | 1100001 | 141 | 61 | |
b | 98 | 1100010 | 142 | 62 | |
c | 99 | 1100011 | 143 | 63 | |
d | 100 | 1100100 | 144 | 64 | |
e | 101 | 1100101 | 145 | 65 | |
f | 102 | 1100110 | 146 | 66 | |
g | 103 | 1100111 | 147 | 67 | |
h | 104 | 1101000 | 150 | 68 | |
i | 105 | 1101001 | 151 | 69 | |
j | 106 | 1101010 | 152 | 6A | |
k | 107 | 1101011 | 153 | 6B | |
l | 108 | 1101100 | 154 | 6C | |
m | 109 | 1101101 | 155 | 6D | |
n | 110 | 1101110 | 156 | 6E | |
o | 111 | 1101111 | 157 | 6F | |
p | 112 | 1110000 | 160 | 70 | |
q | 113 | 1110001 | 161 | 71 | |
r | 114 | 1110010 | 162 | 72 | |
s | 115 | 1110011 | 163 | 73 | |
t | 116 | 1110100 | 164 | 74 | |
u | 117 | 1110101 | 165 | 75 | |
v | 118 | 1110110 | 166 | 76 | |
w | 119 | 1110111 | 167 | 77 | |
x | 120 | 1111000 | 170 | 78 | |
y | 121 | 1111001 | 171 | 79 | |
z | 122 | 1111010 | 172 | 7A | |
{ | 123 | 1111011 | 173 | 7B | |
124 | 1111100 | 174 | 7C | ||
} | 125 | 1111101 | 175 | 7D | |
~ | 126 | 1111110 | 176 | 7E | |
(delete) | 127 | 1111111 | 177 | 7F |