ASCII table

All 128 ASCII codes in decimal, hex, octal and binary, searchable.

DecHexOctBinaryCharNameDescription
00x0000000000000NULNULNull
10x0100100000001SOHSOHStart of heading
20x0200200000010STXSTXStart of text
30x0300300000011ETXETXEnd of text
40x0400400000100EOTEOTEnd of transmission
50x0500500000101ENQENQEnquiry
60x0600600000110ACKACKAcknowledge
70x0700700000111BELBELBell
80x0801000001000BSBSBackspace
90x0901100001001HTHTHorizontal tab
100x0A01200001010LFLFLine feed
110x0B01300001011VTVTVertical tab
120x0C01400001100FFFFForm feed
130x0D01500001101CRCRCarriage return
140x0E01600001110SOSOShift out
150x0F01700001111SISIShift in
160x1002000010000DLEDLEData link escape
170x1102100010001DC1DC1Device control 1 (XON)
180x1202200010010DC2DC2Device control 2
190x1302300010011DC3DC3Device control 3 (XOFF)
200x1402400010100DC4DC4Device control 4
210x1502500010101NAKNAKNegative acknowledge
220x1602600010110SYNSYNSynchronous idle
230x1702700010111ETBETBEnd of block
240x1803000011000CANCANCancel
250x1903100011001EMEMEnd of medium
260x1A03200011010SUBSUBSubstitute
270x1B03300011011ESCESCEscape
280x1C03400011100FSFSFile separator
290x1D03500011101GSGSGroup separator
300x1E03600011110RSRSRecord separator
310x1F03700011111USUSUnit separator
320x2004000100000SP Space
330x2104100100001!!
340x2204200100010""
350x2304300100011##
360x2404400100100$$
370x2504500100101%%
380x2604600100110&&
390x2704700100111''
400x2805000101000((
410x2905100101001))
420x2A05200101010**
430x2B05300101011++
440x2C05400101100,,
450x2D05500101101--
460x2E05600101110..
470x2F05700101111//
480x300600011000000
490x310610011000111
500x320620011001022
510x330630011001133
520x340640011010044
530x350650011010155
540x360660011011066
550x370670011011177
560x380700011100088
570x390710011100199
580x3A07200111010::
590x3B07300111011;;
600x3C07400111100<<
610x3D07500111101==
620x3E07600111110>>
630x3F07700111111??
640x4010001000000@@
650x4110101000001AA
660x4210201000010BB
670x4310301000011CC
680x4410401000100DD
690x4510501000101EE
700x4610601000110FF
710x4710701000111GG
720x4811001001000HH
730x4911101001001II
740x4A11201001010JJ
750x4B11301001011KK
760x4C11401001100LL
770x4D11501001101MM
780x4E11601001110NN
790x4F11701001111OO
800x5012001010000PP
810x5112101010001QQ
820x5212201010010RR
830x5312301010011SS
840x5412401010100TT
850x5512501010101UU
860x5612601010110VV
870x5712701010111WW
880x5813001011000XX
890x5913101011001YY
900x5A13201011010ZZ
910x5B13301011011[[
920x5C13401011100\\
930x5D13501011101]]
940x5E13601011110^^
950x5F13701011111__
960x6014001100000``
970x6114101100001aa
980x6214201100010bb
990x6314301100011cc
1000x6414401100100dd
1010x6514501100101ee
1020x6614601100110ff
1030x6714701100111gg
1040x6815001101000hh
1050x6915101101001ii
1060x6A15201101010jj
1070x6B15301101011kk
1080x6C15401101100ll
1090x6D15501101101mm
1100x6E15601101110nn
1110x6F15701101111oo
1120x7016001110000pp
1130x7116101110001qq
1140x7216201110010rr
1150x7316301110011ss
1160x7416401110100tt
1170x7516501110101uu
1180x7616601110110vv
1190x7716701110111ww
1200x7817001111000xx
1210x7917101111001yy
1220x7A17201111010zz
1230x7B17301111011{{
1240x7C17401111100||
1250x7D17501111101}}
1260x7E17601111110~~
1270x7F17701111111DELDELDelete

Useful arithmetic

'A' = 65, 'a' = 97
The difference is 32 — a single bit. c ^ 32 flips the case of any ASCII letter.
'0' = 48
c − 48 converts a digit character to its value, which is c − '0' in C.
Digits are 0x30–0x39
The low nibble is the digit: 0x37 is '7'. This is why hex dumps of numeric text are readable at a glance.
Uppercase is 0x41–0x5A
Lowercase is 0x61–0x7A. Bit 5 is the case bit.
Space = 32, DEL = 127
Everything printable sits between them.

How it works

ASCII — the American Standard Code for Information Interchange — was standardised in 1963 and assigns a number from 0 to 127 to each character. Seven bits, which is why the eighth bit was free for parity on the teletypes it was designed for.

The layout is deliberate

Nothing about the ordering is accidental. Digits are consecutive so arithmetic works. Uppercase and lowercase are separated by exactly 32 so case conversion is one bit flip. Control characters come first so they sort before printable text. These decisions still shape how string code is written sixty years later.

The control characters that survived

Most of the first 32 codes were for controlling physical teletypes and are now historical. A few remain essential: LF (10) and CR (13) for line endings, HT (9) for tab, ESC (27) which begins every terminal escape sequence, and BEL (7) which still makes many terminals beep. DC1 and DC3 are XON and XOFF — the reason Ctrl-S freezes some terminals.

Why line endings differ

A teletype needed two operations to start a new line: carriage return to move the head back, line feed to advance the paper. Unix chose LF alone, classic Mac OS chose CR alone, and DOS kept both as CRLF. Windows inherited CRLF, which is why files still move between systems with mismatched line endings.

ASCII is a subset of UTF-8

UTF-8 was designed so that every ASCII byte means exactly the same thing in UTF-8. Any ASCII-only file is already valid UTF-8 — a compatibility decision that is a large part of why UTF-8 won over the alternatives.