Skip to content

ASCII Table

Complete ASCII table — all 128 characters with decimal, hexadecimal, octal, binary representations and the standard names of control characters.

All 128 ASCII characters with decimal / hex / octal / binary values and the names of every control character.

ASCII (American Standard Code for Information Interchange) defines 128 characters. The first 32 (0-31) and 127 are control characters used historically by terminals and teletypewriters. 32-126 are printable. Codes 128-255 are not part of ASCII proper — they vary by encoding (Latin-1, Windows-1252, etc.). Modern code uses Unicode/UTF-8, which preserves ASCII 0-127.

Control Characters (0–31, 127)

Non-printing characters used for terminal/protocol control. Most are obsolete in modern computing; the survivors are TAB (9), LF (10), CR (13), and ESC (27).

DecHexOctalBinaryCharDescription
0 0x00 0000 00000000   NUL — null
1 0x01 0001 00000001   SOH — start of heading
2 0x02 0002 00000010   STX — start of text
3 0x03 0003 00000011   ETX — end of text
4 0x04 0004 00000100   EOT — end of transmission
5 0x05 0005 00000101   ENQ — enquiry
6 0x06 0006 00000110   ACK — acknowledge
7 0x07 0007 00000111   BEL — bell
8 0x08 0010 00001000   BS — backspace
9 0x09 0011 00001001   HT — horizontal tab (\t)
10 0x0A 0012 00001010   LF — line feed (\n)
11 0x0B 0013 00001011   VT — vertical tab
12 0x0C 0014 00001100   FF — form feed
13 0x0D 0015 00001101   CR — carriage return (\r)
14 0x0E 0016 00001110   SO — shift out
15 0x0F 0017 00001111   SI — shift in
16 0x10 0020 00010000   DLE — data link escape
17 0x11 0021 00010001   DC1 — device control 1 (XON)
18 0x12 0022 00010010   DC2 — device control 2
19 0x13 0023 00010011   DC3 — device control 3 (XOFF)
20 0x14 0024 00010100   DC4 — device control 4
21 0x15 0025 00010101   NAK — negative acknowledge
22 0x16 0026 00010110   SYN — synchronous idle
23 0x17 0027 00010111   ETB — end of transmission block
24 0x18 0030 00011000   CAN — cancel
25 0x19 0031 00011001   EM — end of medium
26 0x1A 0032 00011010   SUB — substitute
27 0x1B 0033 00011011   ESC — escape
28 0x1C 0034 00011100   FS — file separator
29 0x1D 0035 00011101   GS — group separator
30 0x1E 0036 00011110   RS — record separator
31 0x1F 0037 00011111   US — unit separator
127 0x7F 0177 01111111   DEL — delete

Printable Characters (32–126)

Space, punctuation, digits, letters, and a handful of symbols.

DecHexOctalBinaryCharDescription
32 0x20 0040 00100000   SP — space
33 0x21 0041 00100001 ! printable: "!"
34 0x22 0042 00100010 " printable: """
35 0x23 0043 00100011 # printable: "#"
36 0x24 0044 00100100 $ printable: "$"
37 0x25 0045 00100101 % printable: "%"
38 0x26 0046 00100110 & printable: "&"
39 0x27 0047 00100111 ' printable: "'"
40 0x28 0050 00101000 ( printable: "("
41 0x29 0051 00101001 ) printable: ")"
42 0x2A 0052 00101010 * printable: "*"
43 0x2B 0053 00101011 + printable: "+"
44 0x2C 0054 00101100 , printable: ","
45 0x2D 0055 00101101 - printable: "-"
46 0x2E 0056 00101110 . printable: "."
47 0x2F 0057 00101111 / printable: "/"
48 0x30 0060 00110000 0 printable: "0"
49 0x31 0061 00110001 1 printable: "1"
50 0x32 0062 00110010 2 printable: "2"
51 0x33 0063 00110011 3 printable: "3"
52 0x34 0064 00110100 4 printable: "4"
53 0x35 0065 00110101 5 printable: "5"
54 0x36 0066 00110110 6 printable: "6"
55 0x37 0067 00110111 7 printable: "7"
56 0x38 0070 00111000 8 printable: "8"
57 0x39 0071 00111001 9 printable: "9"
58 0x3A 0072 00111010 : printable: ":"
59 0x3B 0073 00111011 ; printable: ";"
60 0x3C 0074 00111100 < printable: "<"
61 0x3D 0075 00111101 = printable: "="
62 0x3E 0076 00111110 > printable: ">"
63 0x3F 0077 00111111 ? printable: "?"
64 0x40 0100 01000000 @ printable: "@"
65 0x41 0101 01000001 A printable: "A"
66 0x42 0102 01000010 B printable: "B"
67 0x43 0103 01000011 C printable: "C"
68 0x44 0104 01000100 D printable: "D"
69 0x45 0105 01000101 E printable: "E"
70 0x46 0106 01000110 F printable: "F"
71 0x47 0107 01000111 G printable: "G"
72 0x48 0110 01001000 H printable: "H"
73 0x49 0111 01001001 I printable: "I"
74 0x4A 0112 01001010 J printable: "J"
75 0x4B 0113 01001011 K printable: "K"
76 0x4C 0114 01001100 L printable: "L"
77 0x4D 0115 01001101 M printable: "M"
78 0x4E 0116 01001110 N printable: "N"
79 0x4F 0117 01001111 O printable: "O"
80 0x50 0120 01010000 P printable: "P"
81 0x51 0121 01010001 Q printable: "Q"
82 0x52 0122 01010010 R printable: "R"
83 0x53 0123 01010011 S printable: "S"
84 0x54 0124 01010100 T printable: "T"
85 0x55 0125 01010101 U printable: "U"
86 0x56 0126 01010110 V printable: "V"
87 0x57 0127 01010111 W printable: "W"
88 0x58 0130 01011000 X printable: "X"
89 0x59 0131 01011001 Y printable: "Y"
90 0x5A 0132 01011010 Z printable: "Z"
91 0x5B 0133 01011011 [ printable: "["
92 0x5C 0134 01011100 \ printable: "\"
93 0x5D 0135 01011101 ] printable: "]"
94 0x5E 0136 01011110 ^ printable: "^"
95 0x5F 0137 01011111 _ printable: "_"
96 0x60 0140 01100000 ` printable: "`"
97 0x61 0141 01100001 a printable: "a"
98 0x62 0142 01100010 b printable: "b"
99 0x63 0143 01100011 c printable: "c"
100 0x64 0144 01100100 d printable: "d"
101 0x65 0145 01100101 e printable: "e"
102 0x66 0146 01100110 f printable: "f"
103 0x67 0147 01100111 g printable: "g"
104 0x68 0150 01101000 h printable: "h"
105 0x69 0151 01101001 i printable: "i"
106 0x6A 0152 01101010 j printable: "j"
107 0x6B 0153 01101011 k printable: "k"
108 0x6C 0154 01101100 l printable: "l"
109 0x6D 0155 01101101 m printable: "m"
110 0x6E 0156 01101110 n printable: "n"
111 0x6F 0157 01101111 o printable: "o"
112 0x70 0160 01110000 p printable: "p"
113 0x71 0161 01110001 q printable: "q"
114 0x72 0162 01110010 r printable: "r"
115 0x73 0163 01110011 s printable: "s"
116 0x74 0164 01110100 t printable: "t"
117 0x75 0165 01110101 u printable: "u"
118 0x76 0166 01110110 v printable: "v"
119 0x77 0167 01110111 w printable: "w"
120 0x78 0170 01111000 x printable: "x"
121 0x79 0171 01111001 y printable: "y"
122 0x7A 0172 01111010 z printable: "z"
123 0x7B 0173 01111011 { printable: "{"
124 0x7C 0174 01111100 | printable: "|"
125 0x7D 0175 01111101 } printable: "}"
126 0x7E 0176 01111110 ~ printable: "~"

ASCII (American Standard Code for Information Interchange) is the 7-bit character encoding standardized in 1963. It assigns a number 0–127 to each character: 32 control codes (0–31), 95 printable characters (32–126, starting with space), and DEL (127). The table above is a reference for those 128 mappings; nothing on this page leaves your browser.

The structure

RangeCodesContents
0–31ControlNUL, BEL, BS, HT, LF, FF, CR, ESC, etc.
32SpacePrintable whitespace
33–47Punctuation! " # $ % & ' ( ) * + , - . /
48–57Digits0 to 9
58–64More punctuation: ; < = > ? @
65–90UppercaseA to Z
91–96Brackets/symbolsSquare brackets, backslash, caret, underscore, backtick
97–122Lowercasea to z
123–126More symbols{ | } ~
127DELThe lone control code outside the 0–31 range

The layout has consequences: digits are contiguous, so subtracting the ASCII code for 0 (48) from that for 5 (53) gives 5. Uppercase and lowercase letters are 32 apart, so tolower(c) = c | 0x20 for ASCII letters. The space character at 32 is the boundary between control-only and printable.

Control codes that still matter

Control codes came from terminal and communications conventions. Their interpretation depends on the protocol or application; common examples include:

CodeNameUse
0NULC string terminator.
7BELTerminal bell (\a).
8BSBackspace.
9HTHorizontal tab (\t).
10LFLine feed. Unix line terminator.
12FFForm feed. Page break in some contexts.
13CRCarriage return. Half of Windows line terminators (\r\n).
27ESCEscape. Used as the lead-in for ANSI terminal escape sequences.

The Unix vs Windows line-ending split is one of the longest-running compatibility headaches in computing. Unix uses LF (one byte). Windows uses CR LF (two bytes). Old Mac OS used CR alone. Tools that don’t normalize line endings produce silent diff noise across platforms.

ASCII vs Unicode vs UTF-8

ASCII is 7-bit (128 codes). Modern systems use Unicode, which assigns code points to characters across many writing systems. UTF-8 is the variable-length encoding that represents Unicode as bytes:

  • ASCII characters (0–127) encode as themselves — one byte each. This is why a UTF-8 file containing only ASCII is byte-for-byte identical to a pure-ASCII file.
  • Code points 128–2047 encode as two bytes.
  • Unicode scalar values 2048–65535 encode as three bytes, excluding the surrogate range U+D800–U+DFFF.
  • Unicode scalar values 65536–1114111 (U+10000–U+10FFFF) encode as four bytes.

ASCII is, in this sense, a strict subset of UTF-8. Anything that handles UTF-8 correctly handles ASCII correctly. The reverse isn’t true — code that assumes “one byte = one character” breaks immediately on non-ASCII text.

Where the ASCII table is the answer

  • Reading raw bytes in a hex dump. 48 65 6c 6c 6f is Hello because 0x48 = 72 = H, etc. See hex to text.
  • Designing a text-based protocol. ASCII printable characters are unambiguous; control codes have established meanings; non-ASCII bytes signal “this isn’t an ASCII protocol.”
  • Checking an ASCII-only field. A protocol may require printable ASCII. Apply that constraint to the specific field; removing non-ASCII text from general logs would destroy valid names and messages.
  • Implementing a parser. Most parser code paths only care about ASCII for syntax (keywords, punctuation) and only need Unicode-aware logic for string literals.
  • Encoding choices. URL encoding, HTML entity encoding, and base64 all derive from “what subset of ASCII is safe in this context.”

The “extended ASCII” myth

There is no standard “extended ASCII.” Codes 128–255 are not part of ASCII; they’re part of whatever 8-bit encoding interprets the bytes — Latin-1, Windows-1252, MacRoman, KOI8-R, etc. Each assigns different characters to those 128 codes. A byte 0xE9 is é in both Latin-1 and Windows-1252, and И in KOI8-R. In UTF-8 it is a leading byte that needs two valid continuation bytes; it cannot stand alone.

When a website or file shows mojibake (garbled accented characters), it’s almost always a mismatch between the encoding the bytes were written in and the encoding the reader assumes.

Common pitfalls

  • Assuming character ranges work for non-ASCII letters. [A-Za-z] matches ASCII letters only. é, ñ, 中 all fail. Use Unicode property classes (\p{L} in many regex flavors) when you mean “any letter.”
  • Off-by-one with 0 vs 1 indexing. ASCII codes are unambiguously 0-indexed: NUL = 0, A = 65. Some legacy reference materials list them with column/row positions starting at 1, which can confuse readers used to 0-based arrays.
  • Confusing decimal, octal, and hex. 65 decimal = 0o101 octal = 0x41 hex = A. Older Unix documentation uses octal heavily; modern tooling uses hex. The character is the same; the notation differs.
  • Confusing a control character with its escape. JSON strings cannot contain a raw BEL byte or other unescaped U+0000–U+001F control character. The escape \u0007 is valid JSON and decodes to BEL; the receiving application decides what to do with it.

For text-to-byte conversion, see text to hex. For byte-to-character lookup at scale, see hex to text.

Sources and scope

Checked September 27, 2026: Unicode UTF encoding FAQ, UTF-8 specification, and JSON string grammar. Byte examples were also checked using Python codecs.