ASCII table
ASCII assigns a number to 128 characters — the digits, the unaccented Latin letters, common punctuation, and 33 control codes that were never meant to be printed. Every one of them is listed below in decimal, hexadecimal, octal and binary, with its HTML entity number.
The first 32 codes and the last one are controls. Most are historical, from an era of teleprinters and paper tape, but a handful still run everything you type: 9 is Tab, 10 is the Unix newline, 13 is the carriage return that Windows pairs with it, and 27 starts every ANSI escape sequence your terminal uses for colour.
ASCII is the first 128 code points of Unicode, unchanged, which is why it is still the common denominator of nearly every encoding in use. UTF-8 was designed so that any pure-ASCII file is already valid UTF-8, byte for byte.
| Dec | Hex | Oct | Binary | Char | HTML | Name |
|---|
| 0 | 00 | 000 | 00000000 | NUL | � | NullString terminator in C. Not a printable character. |
| 1 | 01 | 001 | 00000001 | SOH |  | Start of headingHistorical; framed the header of a transmission block. |
| 2 | 02 | 002 | 00000010 | STX |  | Start of textHistorical; marked where the message body began. |
| 3 | 03 | 003 | 00000011 | ETX |  | End of textSent by Ctrl+C, which is why that key interrupts a program. |
| 4 | 04 | 004 | 00000100 | EOT |  | End of transmissionSent by Ctrl+D; closes stdin in a Unix shell. |
| 5 | 05 | 005 | 00000101 | ENQ |  | EnquiryHistorical; asked the far end to identify itself. |
| 6 | 06 | 006 | 00000110 | ACK |  | AcknowledgePositive response in older serial protocols. |
| 7 | 07 | 007 | 00000111 | BEL |  | BellRings the terminal bell. Written \a in C. |
| 8 | 08 | 010 | 00001000 | BS |  | BackspaceMoves the cursor back one column. Written \b. |
| 9 | 09 | 011 | 00001001 | HT | 	 | Horizontal tabThe Tab key. Written \t. |
| 10 | 0A | 012 | 00001010 | LF | | Line feedThe Unix newline. Written \n. |
| 11 | 0B | 013 | 00001011 | VT |  | Vertical tabRare; advances to the next vertical tab stop. Written \v. |
| 12 | 0C | 014 | 00001100 | FF |  | Form feedPage break for printers. Written \f. |
| 13 | 0D | 015 | 00001101 | CR | | Carriage returnReturns to column one. Paired with LF on Windows. Written \r. |
| 14 | 0E | 016 | 00001110 | SO |  | Shift outHistorical; switched to an alternate character set. |
| 15 | 0F | 017 | 00001111 | SI |  | Shift inHistorical; switched back to the standard set. |
| 16 | 10 | 020 | 00010000 | DLE |  | Data link escapeHistorical; made the next bytes control data. |
| 17 | 11 | 021 | 00010001 | DC1 |  | Device control 1XON — resumes a paused transmission. Sent by Ctrl+Q. |
| 18 | 12 | 022 | 00010010 | DC2 |  | Device control 2Historical device control. |
| 19 | 13 | 023 | 00010011 | DC3 |  | Device control 3XOFF — pauses transmission. Sent by Ctrl+S. |
| 20 | 14 | 024 | 00010100 | DC4 |  | Device control 4Historical device control. |
| 21 | 15 | 025 | 00010101 | NAK |  | Negative acknowledgeNegative response in older serial protocols. |
| 22 | 16 | 026 | 00010110 | SYN |  | Synchronous idleFilled silence on synchronous links. |
| 23 | 17 | 027 | 00010111 | ETB |  | End of transmission blockHistorical; ended one block of a longer message. |
| 24 | 18 | 030 | 00011000 | CAN |  | CancelDiscards the data sent before it. |
| 25 | 19 | 031 | 00011001 | EM |  | End of mediumMarked the physical end of a tape or card deck. |
| 26 | 1A | 032 | 00011010 | SUB |  | SubstituteEnd-of-file marker in DOS and CP/M. Sent by Ctrl+Z. |
| 27 | 1B | 033 | 00011011 | ESC |  | EscapeStarts an ANSI escape sequence — terminal colours and cursor moves. |
| 28 | 1C | 034 | 00011100 | FS |  | File separatorCoarsest of the four data separators. |
| 29 | 1D | 035 | 00011101 | GS |  | Group separatorSeparates groups within a file. |
| 30 | 1E | 036 | 00011110 | RS |  | Record separatorSeparates records within a group. |
| 31 | 1F | 037 | 00011111 | US |  | Unit separatorFinest separator; occasionally used as a field delimiter. |
| 127 | 7F | 177 | 01111111 | DEL |  | DeleteAll bits punched on paper tape, which is why it is at the top. |
| Dec | Hex | Oct | Binary | Char | HTML | Name |
|---|
| 32 | 20 | 040 | 00100000 | |   | Space |
Punctuation and symbols#
33–47, 58–64, 91–96, 123–126| Dec | Hex | Oct | Binary | Char | HTML | Name |
|---|
| 33 | 21 | 041 | 00100001 | ! | ! | Exclamation mark |
| 34 | 22 | 042 | 00100010 | " | " | Quotation mark |
| 35 | 23 | 043 | 00100011 | # | # | Number sign |
| 36 | 24 | 044 | 00100100 | $ | $ | Dollar sign |
| 37 | 25 | 045 | 00100101 | % | % | Percent sign |
| 38 | 26 | 046 | 00100110 | & | & | Ampersand |
| 39 | 27 | 047 | 00100111 | ' | ' | Apostrophe |
| 40 | 28 | 050 | 00101000 | ( | ( | Left parenthesis |
| 41 | 29 | 051 | 00101001 | ) | ) | Right parenthesis |
| 42 | 2A | 052 | 00101010 | * | * | Asterisk |
| 43 | 2B | 053 | 00101011 | + | + | Plus sign |
| 44 | 2C | 054 | 00101100 | , | , | Comma |
| 45 | 2D | 055 | 00101101 | - | - | Hyphen-minus |
| 46 | 2E | 056 | 00101110 | . | . | Full stop |
| 47 | 2F | 057 | 00101111 | / | / | Solidus |
| 58 | 3A | 072 | 00111010 | : | : | Colon |
| 59 | 3B | 073 | 00111011 | ; | ; | Semicolon |
| 60 | 3C | 074 | 00111100 | < | < | Less-than sign |
| 61 | 3D | 075 | 00111101 | = | = | Equals sign |
| 62 | 3E | 076 | 00111110 | > | > | Greater-than sign |
| 63 | 3F | 077 | 00111111 | ? | ? | Question mark |
| 64 | 40 | 100 | 01000000 | @ | @ | Commercial at |
| 91 | 5B | 133 | 01011011 | [ | [ | Left square bracket |
| 92 | 5C | 134 | 01011100 | \ | \ | Reverse solidus |
| 93 | 5D | 135 | 01011101 | ] | ] | Right square bracket |
| 94 | 5E | 136 | 01011110 | ^ | ^ | Circumflex accent |
| 95 | 5F | 137 | 01011111 | _ | _ | Low line |
| 96 | 60 | 140 | 01100000 | ` | ` | Grave accent |
| 123 | 7B | 173 | 01111011 | { | { | Left curly bracket |
| 124 | 7C | 174 | 01111100 | | | | | Vertical line |
| 125 | 7D | 175 | 01111101 | } | } | Right curly bracket |
| 126 | 7E | 176 | 01111110 | ~ | ~ | Tilde |
| Dec | Hex | Oct | Binary | Char | HTML | Name |
|---|
| 48 | 30 | 060 | 00110000 | 0 | 0 | Digit 0 |
| 49 | 31 | 061 | 00110001 | 1 | 1 | Digit 1 |
| 50 | 32 | 062 | 00110010 | 2 | 2 | Digit 2 |
| 51 | 33 | 063 | 00110011 | 3 | 3 | Digit 3 |
| 52 | 34 | 064 | 00110100 | 4 | 4 | Digit 4 |
| 53 | 35 | 065 | 00110101 | 5 | 5 | Digit 5 |
| 54 | 36 | 066 | 00110110 | 6 | 6 | Digit 6 |
| 55 | 37 | 067 | 00110111 | 7 | 7 | Digit 7 |
| 56 | 38 | 070 | 00111000 | 8 | 8 | Digit 8 |
| 57 | 39 | 071 | 00111001 | 9 | 9 | Digit 9 |
| Dec | Hex | Oct | Binary | Char | HTML | Name |
|---|
| 65 | 41 | 101 | 01000001 | A | A | Capital letter A |
| 66 | 42 | 102 | 01000010 | B | B | Capital letter B |
| 67 | 43 | 103 | 01000011 | C | C | Capital letter C |
| 68 | 44 | 104 | 01000100 | D | D | Capital letter D |
| 69 | 45 | 105 | 01000101 | E | E | Capital letter E |
| 70 | 46 | 106 | 01000110 | F | F | Capital letter F |
| 71 | 47 | 107 | 01000111 | G | G | Capital letter G |
| 72 | 48 | 110 | 01001000 | H | H | Capital letter H |
| 73 | 49 | 111 | 01001001 | I | I | Capital letter I |
| 74 | 4A | 112 | 01001010 | J | J | Capital letter J |
| 75 | 4B | 113 | 01001011 | K | K | Capital letter K |
| 76 | 4C | 114 | 01001100 | L | L | Capital letter L |
| 77 | 4D | 115 | 01001101 | M | M | Capital letter M |
| 78 | 4E | 116 | 01001110 | N | N | Capital letter N |
| 79 | 4F | 117 | 01001111 | O | O | Capital letter O |
| 80 | 50 | 120 | 01010000 | P | P | Capital letter P |
| 81 | 51 | 121 | 01010001 | Q | Q | Capital letter Q |
| 82 | 52 | 122 | 01010010 | R | R | Capital letter R |
| 83 | 53 | 123 | 01010011 | S | S | Capital letter S |
| 84 | 54 | 124 | 01010100 | T | T | Capital letter T |
| 85 | 55 | 125 | 01010101 | U | U | Capital letter U |
| 86 | 56 | 126 | 01010110 | V | V | Capital letter V |
| 87 | 57 | 127 | 01010111 | W | W | Capital letter W |
| 88 | 58 | 130 | 01011000 | X | X | Capital letter X |
| 89 | 59 | 131 | 01011001 | Y | Y | Capital letter Y |
| 90 | 5A | 132 | 01011010 | Z | Z | Capital letter Z |
| 97 | 61 | 141 | 01100001 | a | a | Small letter a |
| 98 | 62 | 142 | 01100010 | b | b | Small letter b |
| 99 | 63 | 143 | 01100011 | c | c | Small letter c |
| 100 | 64 | 144 | 01100100 | d | d | Small letter d |
| 101 | 65 | 145 | 01100101 | e | e | Small letter e |
| 102 | 66 | 146 | 01100110 | f | f | Small letter f |
| 103 | 67 | 147 | 01100111 | g | g | Small letter g |
| 104 | 68 | 150 | 01101000 | h | h | Small letter h |
| 105 | 69 | 151 | 01101001 | i | i | Small letter i |
| 106 | 6A | 152 | 01101010 | j | j | Small letter j |
| 107 | 6B | 153 | 01101011 | k | k | Small letter k |
| 108 | 6C | 154 | 01101100 | l | l | Small letter l |
| 109 | 6D | 155 | 01101101 | m | m | Small letter m |
| 110 | 6E | 156 | 01101110 | n | n | Small letter n |
| 111 | 6F | 157 | 01101111 | o | o | Small letter o |
| 112 | 70 | 160 | 01110000 | p | p | Small letter p |
| 113 | 71 | 161 | 01110001 | q | q | Small letter q |
| 114 | 72 | 162 | 01110010 | r | r | Small letter r |
| 115 | 73 | 163 | 01110011 | s | s | Small letter s |
| 116 | 74 | 164 | 01110100 | t | t | Small letter t |
| 117 | 75 | 165 | 01110101 | u | u | Small letter u |
| 118 | 76 | 166 | 01110110 | v | v | Small letter v |
| 119 | 77 | 167 | 01110111 | w | w | Small letter w |
| 120 | 78 | 170 | 01111000 | x | x | Small letter x |
| 121 | 79 | 171 | 01111001 | y | y | Small letter y |
| 122 | 7A | 172 | 01111010 | z | z | Small letter z |
FAQ
What is the difference between ASCII and UTF-8?
ASCII defines 128 characters, numbered 0 to 127. UTF-8 is an encoding for the whole of Unicode — over 150,000 characters — and it encodes those first 128 as single bytes with exactly the ASCII values. So every ASCII file is a valid UTF-8 file, but the reverse only holds if the text stays inside those 128 characters.
Why does the table stop at 127?
ASCII is a 7-bit standard, and 2⁷ is 128. Codes 128–255 are not ASCII: they belong to whichever 8-bit extension is in play — Windows-1252, ISO-8859-1, and others — which is precisely why they disagree with each other and why text with accents arrives mangled so often.
What is the ASCII code for space?
Decimal 32, hex 20. It is a printable character despite looking like nothing, which is why it sits outside the control range that ends at 31.
Why is DEL at 127 instead of 0?
Paper tape. Deleting a character meant punching out every hole in its position, and all seven bits punched is 127. A deleted character could not be un-deleted, which is also where the modern meaning comes from.
What is the difference between CR and LF?
CR (13) returns the print head to column one; LF (10) advances one line. Unix and macOS end lines with LF alone, Windows uses CR followed by LF, and that disagreement is the reason a file can show up as one long line or with stray ^M characters.