Text & Encoding

ASCII Table

Complete 7-bit ASCII reference — decimal, hex, octal, binary, and character for all 128 codes.

ASCII (American Standard Code for Information Interchange) is a 7-bit character encoding that maps the numbers 0–127 to characters. Established in 1963, it covers the digits, the uppercase and lowercase Latin letters, common punctuation, and 33 non-printing control codes — and it remains the foundation of modern text, because UTF-8 reuses these same 128 code points unchanged. The table below lists every code in decimal, hexadecimal, octal, and binary alongside its character. Codes 0–31 and 127 are control characters (such as TAB, line feed, and carriage return); 32–126 are the printable characters you can type and see.

Full table

DecHexOctBinChar
00x00000000000NUL
10x10010000001SOH
20x20020000010STX
30x30030000011ETX
40x40040000100EOT
50x50050000101ENQ
60x60060000110ACK
70x70070000111BEL
80x80100001000BS
90x90110001001HT
100xA0120001010LF
110xB0130001011VT
120xC0140001100FF
130xD0150001101CR
140xE0160001110SO
150xF0170001111SI
160x100200010000DLE
170x110210010001DC1
180x120220010010DC2
190x130230010011DC3
200x140240010100DC4
210x150250010101NAK
220x160260010110SYN
230x170270010111ETB
240x180300011000CAN
250x190310011001EM
260x1A0320011010SUB
270x1B0330011011ESC
280x1C0340011100FS
290x1D0350011101GS
300x1E0360011110RS
310x1F0370011111US
320x200400100000SP (space)
330x210410100001!
340x220420100010"
350x230430100011#
360x240440100100$
370x250450100101%
380x260460100110&
390x270470100111'
400x280500101000(
410x290510101001)
420x2A0520101010*
430x2B0530101011+
440x2C0540101100,
450x2D0550101101-
460x2E0560101110.
470x2F0570101111/
480x3006001100000
490x3106101100011
500x3206201100102
510x3306301100113
520x3406401101004
530x3506501101015
540x3606601101106
550x3706701101117
560x3807001110008
570x3907101110019
580x3A0720111010:
590x3B0730111011;
600x3C0740111100<
610x3D0750111101=
620x3E0760111110>
630x3F0770111111?
640x401001000000@
650x411011000001A
660x421021000010B
670x431031000011C
680x441041000100D
690x451051000101E
700x461061000110F
710x471071000111G
720x481101001000H
730x491111001001I
740x4A1121001010J
750x4B1131001011K
760x4C1141001100L
770x4D1151001101M
780x4E1161001110N
790x4F1171001111O
800x501201010000P
810x511211010001Q
820x521221010010R
830x531231010011S
840x541241010100T
850x551251010101U
860x561261010110V
870x571271010111W
880x581301011000X
890x591311011001Y
900x5A1321011010Z
910x5B1331011011[
920x5C1341011100\
930x5D1351011101]
940x5E1361011110^
950x5F1371011111_
960x601401100000`
970x611411100001a
980x621421100010b
990x631431100011c
1000x641441100100d
1010x651451100101e
1020x661461100110f
1030x671471100111g
1040x681501101000h
1050x691511101001i
1060x6A1521101010j
1070x6B1531101011k
1080x6C1541101100l
1090x6D1551101101m
1100x6E1561101110n
1110x6F1571101111o
1120x701601110000p
1130x711611110001q
1140x721621110010r
1150x731631110011s
1160x741641110100t
1170x751651110101u
1180x761661110110v
1190x771671110111w
1200x781701111000x
1210x791711111001y
1220x7A1721111010z
1230x7B1731111011{
1240x7C1741111100|
1250x7D1751111101}
1260x7E1761111110~
1270x7F1771111111DEL

Notes

  • Control codes 0–31 originally controlled teletypes; many are still used (CR=13, LF=10, TAB=9, NUL=0).
  • Codes 128–255 depend on codepage — use UTF-8 for anything beyond ASCII.

Frequently asked questions

What is ASCII?

American Standard Code for Information Interchange — a 7-bit character encoding established in 1963 that maps numbers 0–127 to characters: digits, uppercase and lowercase Latin letters, common punctuation, and 33 control codes. It's the foundation of nearly every modern text encoding (UTF-8 includes ASCII as its first 128 code points unchanged), and underlies virtually every text protocol on the internet.

What are control codes?

Codes 0–31 and 127 are non-printing characters originally designed to control teletype machines and terminals. The most commonly seen today: <strong>NUL (0)</strong> string terminator in C; <strong>BEL (7)</strong> the terminal beep; <strong>BS (8)</strong> backspace; <strong>HT (9)</strong> tab; <strong>LF (10)</strong> line feed (Unix newline); <strong>CR (13)</strong> carriage return (paired with LF for Windows newlines); <strong>ESC (27)</strong> escape, the start of ANSI terminal codes; <strong>DEL (127)</strong> delete.

What's the difference between ASCII and Unicode?

ASCII is 128 characters in 7 bits. Unicode is over 149,000 characters across nearly 1.2 million possible code points. UTF-8 is the dominant encoding of Unicode and is backward-compatible with ASCII — the first 128 code points of UTF-8 are byte-for-byte identical to ASCII. So all ASCII text is valid UTF-8; the reverse isn't necessarily true.

Why do some characters take more bytes in UTF-8?

ASCII characters take 1 byte each. Most Latin-extended characters (é, ñ, ö) take 2. CJK characters (中, あ, 한) take 3. Emoji and rare symbols take 4. UTF-8 is a variable-length encoding — the first byte tells you how long the character is. This is why a string of 100 emoji takes 400 bytes.

What about codes 128–255?

Not part of ASCII proper. Various 8-bit extensions assign meaning differently: ISO-8859-1 (Latin-1) covers Western European characters; Windows-1252 is similar but adds smart quotes and em-dashes; KOI8-R covers Cyrillic. These 'extended ASCII' codepages are mostly obsolete — modern systems use Unicode and UTF-8 for everything beyond ASCII.

Why does Windows use CR+LF and Unix use LF?

Historical accident. Teletypes physically required two operations to start a new line: carriage return (move print head to left) and line feed (advance paper). Mac OS classic used CR alone; DEC and Unix used LF alone; Windows kept the original CR+LF. Modern git, editors, and terminals usually handle this transparently, but the difference still causes occasional cross-platform headaches.

Was this article helpful?