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 range | Decimal | Contents |
|---|---|---|
| 00–1F | 0–31 | Control characters |
| 20 | 32 | Space |
| 21–2F | 33–47 | Punctuation and symbols |
| 30–39 | 48–57 | Digits 0–9 |
| 3A–40 | 58–64 | More punctuation |
| 41–5A | 65–90 | Capitals A–Z |
| 5B–60 | 91–96 | Brackets and symbols |
| 61–7A | 97–122 | Lower case a–z |
| 7B–7E | 123–126 | Braces and tilde |
| 7F | 127 | Delete |
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.
| Hex | Decimal | Octal | Binary | Character |
|---|---|---|---|---|
| 00 | 0 | 000 | 00000000 | NUL null |
| 01 | 1 | 001 | 00000001 | SOH start of heading |
| 02 | 2 | 002 | 00000010 | STX start of text |
| 03 | 3 | 003 | 00000011 | ETX end of text |
| 04 | 4 | 004 | 00000100 | EOT end of transmission |
| 05 | 5 | 005 | 00000101 | ENQ enquiry |
| 06 | 6 | 006 | 00000110 | ACK acknowledge |
| 07 | 7 | 007 | 00000111 | BEL bell |
| 08 | 8 | 010 | 00001000 | BS backspace |
| 09 | 9 | 011 | 00001001 | HT horizontal tab |
| 0A | 10 | 012 | 00001010 | LF line feed |
| 0B | 11 | 013 | 00001011 | VT vertical tab |
| 0C | 12 | 014 | 00001100 | FF form feed |
| 0D | 13 | 015 | 00001101 | CR carriage return |
| 0E | 14 | 016 | 00001110 | SO shift out |
| 0F | 15 | 017 | 00001111 | SI shift in |
| 10 | 16 | 020 | 00010000 | DLE data link escape |
| 11 | 17 | 021 | 00010001 | DC1 device control 1 |
| 12 | 18 | 022 | 00010010 | DC2 device control 2 |
| 13 | 19 | 023 | 00010011 | DC3 device control 3 |
| 14 | 20 | 024 | 00010100 | DC4 device control 4 |
| 15 | 21 | 025 | 00010101 | NAK negative acknowledge |
| 16 | 22 | 026 | 00010110 | SYN synchronous idle |
| 17 | 23 | 027 | 00010111 | ETB end of block |
| 18 | 24 | 030 | 00011000 | CAN cancel |
| 19 | 25 | 031 | 00011001 | EM end of medium |
| 1A | 26 | 032 | 00011010 | SUB substitute |
| 1B | 27 | 033 | 00011011 | ESC escape |
| 1C | 28 | 034 | 00011100 | FS file separator |
| 1D | 29 | 035 | 00011101 | GS group separator |
| 1E | 30 | 036 | 00011110 | RS record separator |
| 1F | 31 | 037 | 00011111 | US unit separator |
| 20 | 32 | 040 | 00100000 | SP space |
| 21 | 33 | 041 | 00100001 | ! |
| 22 | 34 | 042 | 00100010 | " |
| 23 | 35 | 043 | 00100011 | # |
| 24 | 36 | 044 | 00100100 | $ |
| 25 | 37 | 045 | 00100101 | % |
| 26 | 38 | 046 | 00100110 | & |
| 27 | 39 | 047 | 00100111 | ' |
| 28 | 40 | 050 | 00101000 | ( |
| 29 | 41 | 051 | 00101001 | ) |
| 2A | 42 | 052 | 00101010 | * |
| 2B | 43 | 053 | 00101011 | + |
| 2C | 44 | 054 | 00101100 | , |
| 2D | 45 | 055 | 00101101 | - |
| 2E | 46 | 056 | 00101110 | . |
| 2F | 47 | 057 | 00101111 | / |
| 30 | 48 | 060 | 00110000 | 0 |
| 31 | 49 | 061 | 00110001 | 1 |
| 32 | 50 | 062 | 00110010 | 2 |
| 33 | 51 | 063 | 00110011 | 3 |
| 34 | 52 | 064 | 00110100 | 4 |
| 35 | 53 | 065 | 00110101 | 5 |
| 36 | 54 | 066 | 00110110 | 6 |
| 37 | 55 | 067 | 00110111 | 7 |
| 38 | 56 | 070 | 00111000 | 8 |
| 39 | 57 | 071 | 00111001 | 9 |
| 3A | 58 | 072 | 00111010 | : |
| 3B | 59 | 073 | 00111011 | ; |
| 3C | 60 | 074 | 00111100 | < |
| 3D | 61 | 075 | 00111101 | = |
| 3E | 62 | 076 | 00111110 | > |
| 3F | 63 | 077 | 00111111 | ? |
| 40 | 64 | 100 | 01000000 | @ |
| 41 | 65 | 101 | 01000001 | A |
| 42 | 66 | 102 | 01000010 | B |
| 43 | 67 | 103 | 01000011 | C |
| 44 | 68 | 104 | 01000100 | D |
| 45 | 69 | 105 | 01000101 | E |
| 46 | 70 | 106 | 01000110 | F |
| 47 | 71 | 107 | 01000111 | G |
| 48 | 72 | 110 | 01001000 | H |
| 49 | 73 | 111 | 01001001 | I |
| 4A | 74 | 112 | 01001010 | J |
| 4B | 75 | 113 | 01001011 | K |
| 4C | 76 | 114 | 01001100 | L |
| 4D | 77 | 115 | 01001101 | M |
| 4E | 78 | 116 | 01001110 | N |
| 4F | 79 | 117 | 01001111 | O |
| 50 | 80 | 120 | 01010000 | P |
| 51 | 81 | 121 | 01010001 | Q |
| 52 | 82 | 122 | 01010010 | R |
| 53 | 83 | 123 | 01010011 | S |
| 54 | 84 | 124 | 01010100 | T |
| 55 | 85 | 125 | 01010101 | U |
| 56 | 86 | 126 | 01010110 | V |
| 57 | 87 | 127 | 01010111 | W |
| 58 | 88 | 130 | 01011000 | X |
| 59 | 89 | 131 | 01011001 | Y |
| 5A | 90 | 132 | 01011010 | Z |
| 5B | 91 | 133 | 01011011 | [ |
| 5C | 92 | 134 | 01011100 | \ |
| 5D | 93 | 135 | 01011101 | ] |
| 5E | 94 | 136 | 01011110 | ^ |
| 5F | 95 | 137 | 01011111 | _ |
| 60 | 96 | 140 | 01100000 | ` |
| 61 | 97 | 141 | 01100001 | a |
| 62 | 98 | 142 | 01100010 | b |
| 63 | 99 | 143 | 01100011 | c |
| 64 | 100 | 144 | 01100100 | d |
| 65 | 101 | 145 | 01100101 | e |
| 66 | 102 | 146 | 01100110 | f |
| 67 | 103 | 147 | 01100111 | g |
| 68 | 104 | 150 | 01101000 | h |
| 69 | 105 | 151 | 01101001 | i |
| 6A | 106 | 152 | 01101010 | j |
| 6B | 107 | 153 | 01101011 | k |
| 6C | 108 | 154 | 01101100 | l |
| 6D | 109 | 155 | 01101101 | m |
| 6E | 110 | 156 | 01101110 | n |
| 6F | 111 | 157 | 01101111 | o |
| 70 | 112 | 160 | 01110000 | p |
| 71 | 113 | 161 | 01110001 | q |
| 72 | 114 | 162 | 01110010 | r |
| 73 | 115 | 163 | 01110011 | s |
| 74 | 116 | 164 | 01110100 | t |
| 75 | 117 | 165 | 01110101 | u |
| 76 | 118 | 166 | 01110110 | v |
| 77 | 119 | 167 | 01110111 | w |
| 78 | 120 | 170 | 01111000 | x |
| 79 | 121 | 171 | 01111001 | y |
| 7A | 122 | 172 | 01111010 | z |
| 7B | 123 | 173 | 01111011 | { |
| 7C | 124 | 174 | 01111100 | | |
| 7D | 125 | 175 | 01111101 | } |
| 7E | 126 | 176 | 01111110 | ~ |
| 7F | 127 | 177 | 01111111 | DEL 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.
| Hex | Name | Escape | Still used for |
|---|---|---|---|
| 00 | NUL | \\0 | End of a C string; padding in binary formats |
| 09 | HT | \\t | Tab — indentation, TSV columns |
| 0A | LF | \\n | Newline on Unix, macOS and in HTTP bodies |
| 0D | CR | \\r | Paired with LF on Windows and in HTTP headers |
| 1B | ESC | \\x1B | Opens a terminal escape sequence for color and cursor moves |
| 7F | DEL | Originally 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.