ASCII Table
ASCII stands for American Standard Code for Information Interchange.
It is a table that maps numbers to characters and control signals.
It is one of the historical foundations of computing because it makes one central idea very clear:
text is also numeric data.
Once you understand ASCII, it becomes much easier to understand:
- why
'A'equals65 - why
'0'equals48 - how strings are stored
- how parsing and serialization work
- why bytes can be read as text or as numbers
If you are reading the Data Types page, this table is the natural companion.
How to read the table
Section titled “How to read the table”DEC: decimal valueHEX: hexadecimal valueBIN: 8-bit binary valueCHAR: printable character when applicableNAME: code or character name
Control codes: 0 to 31 and 127
Section titled “Control codes: 0 to 31 and 127”DEC HEX BIN CHAR NAME0 00 00000000 NUL1 01 00000001 SOH2 02 00000010 STX3 03 00000011 ETX4 04 00000100 EOT5 05 00000101 ENQ6 06 00000110 ACK7 07 00000111 BEL8 08 00001000 BS9 09 00001001 TAB10 0A 00001010 LF11 0B 00001011 VT12 0C 00001100 FF13 0D 00001101 CR14 0E 00001110 SO15 0F 00001111 SI16 10 00010000 DLE17 11 00010001 DC118 12 00010010 DC219 13 00010011 DC320 14 00010100 DC421 15 00010101 NAK22 16 00010110 SYN23 17 00010111 ETB24 18 00011000 CAN25 19 00011001 EM26 1A 00011010 SUB27 1B 00011011 ESC28 1C 00011100 FS29 1D 00011101 GS30 1E 00011110 RS31 1F 00011111 US127 7F 01111111 DELWhat those control codes were for
Section titled “What those control codes were for”These codes were created for teletypes, terminals, and printers.
Some still show up a lot:
TAB(9): horizontal tabLF(10): line feed, line break in many systemsCR(13): carriage returnESC(27): escape
Printable characters: 32 to 47
Section titled “Printable characters: 32 to 47”DEC HEX BIN CHAR NAME32 20 00100000 SP SPACE33 21 00100001 ! EXCLAMATION MARK34 22 00100010 " QUOTATION MARK35 23 00100011 # NUMBER SIGN36 24 00100100 $ DOLLAR SIGN37 25 00100101 % PERCENT SIGN38 26 00100110 & AMPERSAND39 27 00100111 ' APOSTROPHE40 28 00101000 ( LEFT PARENTHESIS41 29 00101001 ) RIGHT PARENTHESIS42 2A 00101010 * ASTERISK43 2B 00101011 + PLUS SIGN44 2C 00101100 , COMMA45 2D 00101101 - HYPHEN-MINUS46 2E 00101110 . FULL STOP47 2F 00101111 / SLASHDigits and punctuation: 48 to 64
Section titled “Digits and punctuation: 48 to 64”DEC HEX BIN CHAR NAME48 30 00110000 0 DIGIT ZERO49 31 00110001 1 DIGIT ONE50 32 00110010 2 DIGIT TWO51 33 00110011 3 DIGIT THREE52 34 00110100 4 DIGIT FOUR53 35 00110101 5 DIGIT FIVE54 36 00110110 6 DIGIT SIX55 37 00110111 7 DIGIT SEVEN56 38 00111000 8 DIGIT EIGHT57 39 00111001 9 DIGIT NINE58 3A 00111010 : COLON59 3B 00111011 ; SEMICOLON60 3C 00111100 < LESS-THAN SIGN61 3D 00111101 = EQUALS SIGN62 3E 00111110 > GREATER-THAN SIGN63 3F 00111111 ? QUESTION MARK64 40 01000000 @ AT SIGNUppercase letters: 65 to 90
Section titled “Uppercase letters: 65 to 90”DEC HEX BIN CHAR NAME65 41 01000001 A LATIN CAPITAL LETTER A66 42 01000010 B LATIN CAPITAL LETTER B67 43 01000011 C LATIN CAPITAL LETTER C68 44 01000100 D LATIN CAPITAL LETTER D69 45 01000101 E LATIN CAPITAL LETTER E70 46 01000110 F LATIN CAPITAL LETTER F71 47 01000111 G LATIN CAPITAL LETTER G72 48 01001000 H LATIN CAPITAL LETTER H73 49 01001001 I LATIN CAPITAL LETTER I74 4A 01001010 J LATIN CAPITAL LETTER J75 4B 01001011 K LATIN CAPITAL LETTER K76 4C 01001100 L LATIN CAPITAL LETTER L77 4D 01001101 M LATIN CAPITAL LETTER M78 4E 01001110 N LATIN CAPITAL LETTER N79 4F 01001111 O LATIN CAPITAL LETTER O80 50 01010000 P LATIN CAPITAL LETTER P81 51 01010001 Q LATIN CAPITAL LETTER Q82 52 01010010 R LATIN CAPITAL LETTER R83 53 01010011 S LATIN CAPITAL LETTER S84 54 01010100 T LATIN CAPITAL LETTER T85 55 01010101 U LATIN CAPITAL LETTER U86 56 01010110 V LATIN CAPITAL LETTER V87 57 01010111 W LATIN CAPITAL LETTER W88 58 01011000 X LATIN CAPITAL LETTER X89 59 01011001 Y LATIN CAPITAL LETTER Y90 5A 01011010 Z LATIN CAPITAL LETTER ZSymbols: 91 to 96
Section titled “Symbols: 91 to 96”DEC HEX BIN CHAR NAME91 5B 01011011 [ LEFT SQUARE BRACKET92 5C 01011100 \ BACKSLASH93 5D 01011101 ] RIGHT SQUARE BRACKET94 5E 01011110 ^ CIRCUMFLEX ACCENT95 5F 01011111 _ UNDERSCORE96 60 01100000 ` GRAVE ACCENTLowercase letters: 97 to 122
Section titled “Lowercase letters: 97 to 122”DEC HEX BIN CHAR NAME97 61 01100001 a LATIN SMALL LETTER A98 62 01100010 b LATIN SMALL LETTER B99 63 01100011 c LATIN SMALL LETTER C100 64 01100100 d LATIN SMALL LETTER D101 65 01100101 e LATIN SMALL LETTER E102 66 01100110 f LATIN SMALL LETTER F103 67 01100111 g LATIN SMALL LETTER G104 68 01101000 h LATIN SMALL LETTER H105 69 01101001 i LATIN SMALL LETTER I106 6A 01101010 j LATIN SMALL LETTER J107 6B 01101011 k LATIN SMALL LETTER K108 6C 01101100 l LATIN SMALL LETTER L109 6D 01101101 m LATIN SMALL LETTER M110 6E 01101110 n LATIN SMALL LETTER N111 6F 01101111 o LATIN SMALL LETTER O112 70 01110000 p LATIN SMALL LETTER P113 71 01110001 q LATIN SMALL LETTER Q114 72 01110010 r LATIN SMALL LETTER R115 73 01110011 s LATIN SMALL LETTER S116 74 01110100 t LATIN SMALL LETTER T117 75 01110101 u LATIN SMALL LETTER U118 76 01110110 v LATIN SMALL LETTER V119 77 01110111 w LATIN SMALL LETTER W120 78 01111000 x LATIN SMALL LETTER X121 79 01111001 y LATIN SMALL LETTER Y122 7A 01111010 z LATIN SMALL LETTER ZFinal symbols: 123 to 126
Section titled “Final symbols: 123 to 126”DEC HEX BIN CHAR NAME123 7B 01111011 { LEFT CURLY BRACKET124 7C 01111100 | VERTICAL LINE125 7D 01111101 } RIGHT CURLY BRACKET126 7E 01111110 ~ TILDEUseful patterns to memorize
Section titled “Useful patterns to memorize”There are a few very useful patterns:
- digits
0to9go from48to57 - uppercase letters
AtoZgo from65to90 - lowercase letters
atozgo from97to122
Difference between uppercase and lowercase:
'A' = 65'a' = 97
97 - 65 = 32That offset of 32 appears a lot in simple text transformations.
Quick code examples
Section titled “Quick code examples”#include <stdio.h>
int main(void) { char c = 'A'; printf("%d\n", c); // 65}#include <iostream>
int main() { std::cout << static_cast<int>('A') << '\n'; // 65}JavaScript
Section titled “JavaScript”console.log('A'.charCodeAt(0)); // 65console.log(String.fromCharCode(65)); // APython
Section titled “Python”print(ord('A')) # 65print(chr(65)) # AA bit of history
Section titled “A bit of history”ASCII was standardized in the 1960s to allow consistent communication between different machines.
At the time, that was a huge deal.
Without a shared standard, each machine could invent its own text encoding.
ASCII helped unify:
- terminals
- printers
- protocols
- text files
- operating systems
Later came extensions and, eventually, Unicode to cover the rest of the world.
Does ASCII still matter today?
Section titled “Does ASCII still matter today?”Yes. A lot.
Even though modern software uses Unicode, ASCII is still important because:
- the first 128 Unicode code points match ASCII
- many protocols and formats still assume ASCII in critical parts
- debugging bytes, logs, parsing, and networking becomes much easier when you know these values
Next actions
Section titled “Next actions”- Go back to Data Types
- Then continue to Data Structures