ASCII Table (Decimal, Hex, Octal, Binary, Character)
Every ASCII code from 0 to 127 is on this page, with its character, name, hex, octal and binary form, and a row anchor you can link to.
text
What is the ASCII table?
The ASCII table lists 128 characters (codes 0-127) with each code in decimal, hex, octal and binary. Codes 0-31 and 127 are control characters; 32-126 are the printable letters, digits and symbols.
ASCII defines 128 characters, codes 0–127, using 7 bits; in practice each code is stored in one 8-bit byte with a leading 0.
ASCII codes 32–126 are printable characters; 0–31 and 127 are control characters (for example 10 = line feed, 13 = carriage return, 32 = space).
That split leaves 95 printable characters and 33 control codes. Each row below holds one code in all four bases, so a lookup is a single line: find the number in the first column and read across.
The table is a lookup, not a calculation. An ASCII code has no place value of its own; the hex, octal and binary columns are the same number written in another base, and what a base is and why position matters sets out how that rewriting works.
| Property | Value |
|---|---|
| What ASCII is | 7-bit standard mapping 128 characters to integers 0–127 |
| Code range | 0–127 |
| Characters | 128 |
| Bits per code | 7 |
| Bits per stored byte | 8 |
| How a code is stored | stored in one 8-bit byte with a leading 0 |
| Control codes | 0–31, 127 |
| Control code count | 33 |
| Printable codes | 32–126 |
| Printable count | 95 |
| Uppercase letters | 65–90 (A–Z) |
| Lowercase letters | 97–122 (a–z) |
| Digits | 48–57 (0–9) |
| Case offset | 32 |
| Case bit | bit 5 (value 32) |
| Place value | none — lookup, not a positional system |
| First published | 1963 |
| Dec | Char | Hex | Oct | Bin |
|---|---|---|---|---|
| 0 | NUL | 00 | 000 | 00000000 |
| 1 | SOH | 01 | 001 | 00000001 |
| 2 | STX | 02 | 002 | 00000010 |
| 3 | ETX | 03 | 003 | 00000011 |
| 4 | EOT | 04 | 004 | 00000100 |
| 5 | ENQ | 05 | 005 | 00000101 |
| 6 | ACK | 06 | 006 | 00000110 |
| 7 | BEL | 07 | 007 | 00000111 |
| 8 | BS | 08 | 010 | 00001000 |
| 9 | HT | 09 | 011 | 00001001 |
| 10 | LF | 0A | 012 | 00001010 |
| 11 | VT | 0B | 013 | 00001011 |
| 12 | FF | 0C | 014 | 00001100 |
| 13 | CR | 0D | 015 | 00001101 |
| 14 | SO | 0E | 016 | 00001110 |
| 15 | SI | 0F | 017 | 00001111 |
| 16 | DLE | 10 | 020 | 00010000 |
| 17 | DC1 | 11 | 021 | 00010001 |
| 18 | DC2 | 12 | 022 | 00010010 |
| 19 | DC3 | 13 | 023 | 00010011 |
| 20 | DC4 | 14 | 024 | 00010100 |
| 21 | NAK | 15 | 025 | 00010101 |
| 22 | SYN | 16 | 026 | 00010110 |
| 23 | ETB | 17 | 027 | 00010111 |
| 24 | CAN | 18 | 030 | 00011000 |
| 25 | EM | 19 | 031 | 00011001 |
| 26 | SUB | 1A | 032 | 00011010 |
| 27 | ESC | 1B | 033 | 00011011 |
| 28 | FS | 1C | 034 | 00011100 |
| 29 | GS | 1D | 035 | 00011101 |
| 30 | RS | 1E | 036 | 00011110 |
| 31 | US | 1F | 037 | 00011111 |
| 32 | (space) | 20 | 040 | 00100000 |
| 33 | ! | 21 | 041 | 00100001 |
| 34 | " | 22 | 042 | 00100010 |
| 35 | # | 23 | 043 | 00100011 |
| 36 | $ | 24 | 044 | 00100100 |
| 37 | % | 25 | 045 | 00100101 |
| 38 | & | 26 | 046 | 00100110 |
| 39 | ' | 27 | 047 | 00100111 |
| 40 | ( | 28 | 050 | 00101000 |
| 41 | ) | 29 | 051 | 00101001 |
| 42 | * | 2A | 052 | 00101010 |
| 43 | + | 2B | 053 | 00101011 |
| 44 | , | 2C | 054 | 00101100 |
| 45 | - | 2D | 055 | 00101101 |
| 46 | . | 2E | 056 | 00101110 |
| 47 | / | 2F | 057 | 00101111 |
| 48 | 0 | 30 | 060 | 00110000 |
| 49 | 1 | 31 | 061 | 00110001 |
| 50 | 2 | 32 | 062 | 00110010 |
| 51 | 3 | 33 | 063 | 00110011 |
| 52 | 4 | 34 | 064 | 00110100 |
| 53 | 5 | 35 | 065 | 00110101 |
| 54 | 6 | 36 | 066 | 00110110 |
| 55 | 7 | 37 | 067 | 00110111 |
| 56 | 8 | 38 | 070 | 00111000 |
| 57 | 9 | 39 | 071 | 00111001 |
| 58 | : | 3A | 072 | 00111010 |
| 59 | ; | 3B | 073 | 00111011 |
| 60 | < | 3C | 074 | 00111100 |
| 61 | = | 3D | 075 | 00111101 |
| 62 | > | 3E | 076 | 00111110 |
| 63 | ? | 3F | 077 | 00111111 |
| 64 | @ | 40 | 100 | 01000000 |
| 65 | A | 41 | 101 | 01000001 |
| 66 | B | 42 | 102 | 01000010 |
| 67 | C | 43 | 103 | 01000011 |
| 68 | D | 44 | 104 | 01000100 |
| 69 | E | 45 | 105 | 01000101 |
| 70 | F | 46 | 106 | 01000110 |
| 71 | G | 47 | 107 | 01000111 |
| 72 | H | 48 | 110 | 01001000 |
| 73 | I | 49 | 111 | 01001001 |
| 74 | J | 4A | 112 | 01001010 |
| 75 | K | 4B | 113 | 01001011 |
| 76 | L | 4C | 114 | 01001100 |
| 77 | M | 4D | 115 | 01001101 |
| 78 | N | 4E | 116 | 01001110 |
| 79 | O | 4F | 117 | 01001111 |
| 80 | P | 50 | 120 | 01010000 |
| 81 | Q | 51 | 121 | 01010001 |
| 82 | R | 52 | 122 | 01010010 |
| 83 | S | 53 | 123 | 01010011 |
| 84 | T | 54 | 124 | 01010100 |
| 85 | U | 55 | 125 | 01010101 |
| 86 | V | 56 | 126 | 01010110 |
| 87 | W | 57 | 127 | 01010111 |
| 88 | X | 58 | 130 | 01011000 |
| 89 | Y | 59 | 131 | 01011001 |
| 90 | Z | 5A | 132 | 01011010 |
| 91 | [ | 5B | 133 | 01011011 |
| 92 | \ | 5C | 134 | 01011100 |
| 93 | ] | 5D | 135 | 01011101 |
| 94 | ^ | 5E | 136 | 01011110 |
| 95 | _ | 5F | 137 | 01011111 |
| 96 | ` | 60 | 140 | 01100000 |
| 97 | a | 61 | 141 | 01100001 |
| 98 | b | 62 | 142 | 01100010 |
| 99 | c | 63 | 143 | 01100011 |
| 100 | d | 64 | 144 | 01100100 |
| 101 | e | 65 | 145 | 01100101 |
| 102 | f | 66 | 146 | 01100110 |
| 103 | g | 67 | 147 | 01100111 |
| 104 | h | 68 | 150 | 01101000 |
| 105 | i | 69 | 151 | 01101001 |
| 106 | j | 6A | 152 | 01101010 |
| 107 | k | 6B | 153 | 01101011 |
| 108 | l | 6C | 154 | 01101100 |
| 109 | m | 6D | 155 | 01101101 |
| 110 | n | 6E | 156 | 01101110 |
| 111 | o | 6F | 157 | 01101111 |
| 112 | p | 70 | 160 | 01110000 |
| 113 | q | 71 | 161 | 01110001 |
| 114 | r | 72 | 162 | 01110010 |
| 115 | s | 73 | 163 | 01110011 |
| 116 | t | 74 | 164 | 01110100 |
| 117 | u | 75 | 165 | 01110101 |
| 118 | v | 76 | 166 | 01110110 |
| 119 | w | 77 | 167 | 01110111 |
| 120 | x | 78 | 170 | 01111000 |
| 121 | y | 79 | 171 | 01111001 |
| 122 | z | 7A | 172 | 01111010 |
| 123 | { | 7B | 173 | 01111011 |
| 124 | | | 7C | 174 | 01111100 |
| 125 | } | 7D | 175 | 01111101 |
| 126 | ~ | 7E | 176 | 01111110 |
| 127 | DEL | 7F | 177 | 01111111 |
Every row has its own address, so a converter can point at the one it used: the row for 65 is at #65 and the row for the space is at #space.
One row answers one character. To run a whole line of codes, convert binary to ASCII code or convert hex bytes to ASCII codes. Going the other way, ASCII to binary table (8-bit codes) writes each code as 8 bits, and decode 8-bit groups into readable text takes a full message.
A string is one row per character. 'Hi' is 72 105 in decimal, 48 69 in hex, 110 151 in octal and 01001000 01101001 in binary — two rows of this table, read in order.
Why is ASCII a 7-bit code?
ASCII uses 7 bits because 7 bits address 128 values, which covered everything the 1963 standard needed: the English alphabet in both cases, the ten digits, punctuation and the teleprinter control codes of the day. The current text of the standard is ANSI X3.4-1986.
The eighth bit was spare. A machine stores one code in one 8-bit byte, so an ASCII byte always opens with a 0, and the 128 values that leading 1 would reach are outside the standard.
Codes 128–255 are not part of ASCII. They belong to extended sets such as Latin-1 (ISO 8859-1), where 255 is ÿ; in pure ASCII a value above 127 is out of range.
Above 127 the byte count stops matching the character count — UTF-8 encoding explained takes it from there.
What are the ASCII codes for the digits 0-9?
The digits run from code 48 to code 57, so a digit's code is its face value plus 48. The character 0 is code 48 and the character 9 is code 57.
| Dec | Char | Hex | Oct | Bin |
|---|---|---|---|---|
| 48 | 0 | 30 | 060 | 00110000 |
| 49 | 1 | 31 | 061 | 00110001 |
| 50 | 2 | 32 | 062 | 00110010 |
| 51 | 3 | 33 | 063 | 00110011 |
| 52 | 4 | 34 | 064 | 00110100 |
| 53 | 5 | 35 | 065 | 00110101 |
| 54 | 6 | 36 | 066 | 00110110 |
| 55 | 7 | 37 | 067 | 00110111 |
| 56 | 8 | 38 | 070 | 00111000 |
| 57 | 9 | 39 | 071 | 00111001 |
That offset is why a character code has to be converted before it can be used as a number. The code for the character 7 is 55, and adding it to another code adds 48 twice.
Why is a = 97 when A = 65?
Uppercase and lowercase are two separate runs in the table. A to Z occupy 65 to 90 and a to z occupy 97 to 122, so each alphabetic character appears twice, 32 apart.
A is ASCII 65 = 0x41 = 0o101 = 0b01000001; a is 97 = 0x61 = 0o141 = 0b01100001. Uppercase and lowercase differ by 32, which is bit 5.
That 32 is a single bit. Clearing bit 5 moves a code from the lower run to the upper one and setting it does the reverse, which is why changing case needs no table at all.
What are the ASCII control characters (0-31 and 127)?
Codes 0 to 31 and code 127 are control characters: 33 codes that carry an instruction rather than print a mark.
Most of them date from teleprinters and never appear in modern text. The survivors mark the ends of lines and fields — 9 = horizontal tab, 10 = line feed, 13 = carriage return — which is why a file moved between systems can gain or lose a byte on every line. A converter shows a control code by its short name, because it has no glyph to print.
| Dec | Char | Name | Hex | Bin |
|---|---|---|---|---|
| 0 | NUL | NUL (null) | 00 | 00000000 |
| 1 | SOH | SOH (start of heading) | 01 | 00000001 |
| 2 | STX | STX (start of text) | 02 | 00000010 |
| 3 | ETX | ETX (end of text) | 03 | 00000011 |
| 4 | EOT | EOT (end of transmission) | 04 | 00000100 |
| 5 | ENQ | ENQ (enquiry) | 05 | 00000101 |
| 6 | ACK | ACK (acknowledge) | 06 | 00000110 |
| 7 | BEL | BEL (bell) | 07 | 00000111 |
| 8 | BS | BS (backspace) | 08 | 00001000 |
| 9 | HT | HT (horizontal tab) | 09 | 00001001 |
| 10 | LF | LF (line feed) | 0A | 00001010 |
| 11 | VT | VT (vertical tab) | 0B | 00001011 |
| 12 | FF | FF (form feed) | 0C | 00001100 |
| 13 | CR | CR (carriage return) | 0D | 00001101 |
| 14 | SO | SO (shift out) | 0E | 00001110 |
| 15 | SI | SI (shift in) | 0F | 00001111 |
| 16 | DLE | DLE (data link escape) | 10 | 00010000 |
| 17 | DC1 | DC1 (device control 1) | 11 | 00010001 |
| 18 | DC2 | DC2 (device control 2) | 12 | 00010010 |
| 19 | DC3 | DC3 (device control 3) | 13 | 00010011 |
| 20 | DC4 | DC4 (device control 4) | 14 | 00010100 |
| 21 | NAK | NAK (negative acknowledge) | 15 | 00010101 |
| 22 | SYN | SYN (synchronous idle) | 16 | 00010110 |
| 23 | ETB | ETB (end of transmission block) | 17 | 00010111 |
| 24 | CAN | CAN (cancel) | 18 | 00011000 |
| 25 | EM | EM (end of medium) | 19 | 00011001 |
| 26 | SUB | SUB (substitute) | 1A | 00011010 |
| 27 | ESC | ESC (escape) | 1B | 00011011 |
| 28 | FS | FS (file separator) | 1C | 00011100 |
| 29 | GS | GS (group separator) | 1D | 00011101 |
| 30 | RS | RS (record separator) | 1E | 00011110 |
| 31 | US | US (unit separator) | 1F | 00011111 |
| 127 | DEL | DEL (delete) | 7F | 01111111 |
Frequently Asked Questions
How do you read the same ASCII code in binary, hex and octal?
Read across its row. 'A' is 65 in decimal, 41 in hex, 101 in octal and 01000001 in binary — one code, four ways of writing the same number.
The rest of the family sits on the binary converter index.