0xCONVERTER-HEX

Reference

ASCII Hex Table

All 128 ASCII codes with their hex, decimal, octal and binary values, control characters included.

How the table is arranged

ASCII is not an arbitrary list. Its layout was designed so that common operations became single bit manipulations, and the structure is still visible.

Hex rangeDecimalContents
00–1F0–31Control characters
2032Space
21–2F33–47Punctuation and symbols
30–3948–57Digits 0–9
3A–4058–64More punctuation
41–5A65–90Capitals A–Z
5B–6091–96Brackets and symbols
61–7A97–122Lower case a–z
7B–7E123–126Braces and tilde
7F127Delete
Two design decisions still worth knowing

Digits start at 30, so the hex code for any digit is 3 followed by the digit itself — 37 is 7. And upper and lower case differ by exactly 20, a single bit, so changing case was historically one bitwise operation rather than a lookup.

Full ASCII table

All 128 codes. Control characters are named rather than rendered, because most of them have no visible form.

HexDecimalOctalBinaryCharacter
00000000000000NUL null
01100100000001SOH start of heading
02200200000010STX start of text
03300300000011ETX end of text
04400400000100EOT end of transmission
05500500000101ENQ enquiry
06600600000110ACK acknowledge
07700700000111BEL bell
08801000001000BS backspace
09901100001001HT horizontal tab
0A1001200001010LF line feed
0B1101300001011VT vertical tab
0C1201400001100FF form feed
0D1301500001101CR carriage return
0E1401600001110SO shift out
0F1501700001111SI shift in
101602000010000DLE data link escape
111702100010001DC1 device control 1
121802200010010DC2 device control 2
131902300010011DC3 device control 3
142002400010100DC4 device control 4
152102500010101NAK negative acknowledge
162202600010110SYN synchronous idle
172302700010111ETB end of block
182403000011000CAN cancel
192503100011001EM end of medium
1A2603200011010SUB substitute
1B2703300011011ESC escape
1C2803400011100FS file separator
1D2903500011101GS group separator
1E3003600011110RS record separator
1F3103700011111US unit separator
203204000100000SP space
213304100100001!
223404200100010"
233504300100011#
243604400100100$
253704500100101%
263804600100110&
273904700100111'
284005000101000(
294105100101001)
2A4205200101010*
2B4305300101011+
2C4405400101100,
2D4505500101101-
2E4605600101110.
2F4705700101111/
3048060001100000
3149061001100011
3250062001100102
3351063001100113
3452064001101004
3553065001101015
3654066001101106
3755067001101117
3856070001110008
3957071001110019
3A5807200111010:
3B5907300111011;
3C6007400111100<
3D6107500111101=
3E6207600111110>
3F6307700111111?
406410001000000@
416510101000001A
426610201000010B
436710301000011C
446810401000100D
456910501000101E
467010601000110F
477110701000111G
487211001001000H
497311101001001I
4A7411201001010J
4B7511301001011K
4C7611401001100L
4D7711501001101M
4E7811601001110N
4F7911701001111O
508012001010000P
518112101010001Q
528212201010010R
538312301010011S
548412401010100T
558512501010101U
568612601010110V
578712701010111W
588813001011000X
598913101011001Y
5A9013201011010Z
5B9113301011011[
5C9213401011100\
5D9313501011101]
5E9413601011110^
5F9513701011111_
609614001100000`
619714101100001a
629814201100010b
639914301100011c
6410014401100100d
6510114501100101e
6610214601100110f
6710314701100111g
6810415001101000h
6910515101101001i
6A10615201101010j
6B10715301101011k
6C10815401101100l
6D10915501101101m
6E11015601101110n
6F11115701101111o
7011216001110000p
7111316101110001q
7211416201110010r
7311516301110011s
7411616401110100t
7511716501110101u
7611816601110110v
7711916701110111w
7812017001111000x
7912117101111001y
7A12217201111010z
7B12317301111011{
7C12417401111100|
7D12517501111101}
7E12617601111110~
7F12717701111111DEL delete

The control characters that still matter

Most of the first 32 codes were designed for teleprinters and are now historical. These six are not.

HexNameEscapeStill used for
00NUL\\0End of a C string; padding in binary formats
09HT\\tTab — indentation, TSV columns
0ALF\\nNewline on Unix, macOS and in HTTP bodies
0DCR\\rPaired with LF on Windows and in HTTP headers
1BESC\\x1BOpens a terminal escape sequence for color and cursor moves
7FDELOriginally punched-out tape; still sent by some keyboards

Seeing 0D 0A at every line ending tells you a file came from Windows or a network protocol. Seeing 0A alone tells you it did not. The decoded text looks identical either way; only the hex shows the difference.

Above 7F is not ASCII

ASCII defines 128 codes and stops. Anything from 80 upward belongs to some extension, and which extension changes the meaning entirely. The byte E9 is é in Latin-1 and the start of a three-byte sequence in UTF-8.

For anything modern, assume UTF-8 and use the hex to text converter, which decodes multi-byte characters correctly instead of guessing.

Frequently asked questions

What is 41 in ASCII?

Capital A. Lower case a is 61, exactly 20 hex higher, because case differs by a single bit.

What is the ASCII code for space?

32 decimal, which is 20 in hex. It is a real byte.

How many characters does ASCII define?

128, numbered 0 to 127. Codes 0 to 31 and 127 are control characters rather than printable.

Why do digits start at hex 30?

So the hex code for a digit is 3 followed by the digit itself. It made converting between a character and its numeric value trivial.

What are the codes above 127?

Not ASCII. They belong to an extension such as Latin-1 or UTF-8, and you must know which one to decode them correctly.

What is the difference between CR and LF?

LF is 0A and ends a line on Unix and macOS. CR is 0D, and Windows and HTTP headers use CR followed by LF.