ASCII Table
Every ASCII character from 0 to 127 with its decimal, hexadecimal, binary, octal and HTML entity representation — filterable, and with the control characters explained.
Control characters (0–31 and 127)
The first 32 codes and code 127 are non-printing control characters. They were designed for teleprinters and serial terminals: ring the bell, advance the paper, return the carriage. Most are historical curiosities today, but a handful remain essential.
| Dec | Hex | Binary | Octal | Char | HTML | Description |
|---|---|---|---|---|---|---|
| 0 | 0x00 | 00000000 | 0o000 | NUL | � | Null |
| 1 | 0x01 | 00000001 | 0o001 | SOH |  | Start of heading |
| 2 | 0x02 | 00000010 | 0o002 | STX |  | Start of text |
| 3 | 0x03 | 00000011 | 0o003 | ETX |  | End of text |
| 4 | 0x04 | 00000100 | 0o004 | EOT |  | End of transmission |
| 5 | 0x05 | 00000101 | 0o005 | ENQ |  | Enquiry |
| 6 | 0x06 | 00000110 | 0o006 | ACK |  | Acknowledge |
| 7 | 0x07 | 00000111 | 0o007 | BEL |  | Bell / alert |
| 8 | 0x08 | 00001000 | 0o010 | BS |  | Backspace |
| 9 | 0x09 | 00001001 | 0o011 | HT | 	 | Horizontal tab |
| 10 | 0x0A | 00001010 | 0o012 | LF | | Line feed |
| 11 | 0x0B | 00001011 | 0o013 | VT |  | Vertical tab |
| 12 | 0x0C | 00001100 | 0o014 | FF |  | Form feed |
| 13 | 0x0D | 00001101 | 0o015 | CR | | Carriage return |
| 14 | 0x0E | 00001110 | 0o016 | SO |  | Shift out |
| 15 | 0x0F | 00001111 | 0o017 | SI |  | Shift in |
| 16 | 0x10 | 00010000 | 0o020 | DLE |  | Data link escape |
| 17 | 0x11 | 00010001 | 0o021 | DC1 |  | Device control 1 |
| 18 | 0x12 | 00010010 | 0o022 | DC2 |  | Device control 2 |
| 19 | 0x13 | 00010011 | 0o023 | DC3 |  | Device control 3 |
| 20 | 0x14 | 00010100 | 0o024 | DC4 |  | Device control 4 |
| 21 | 0x15 | 00010101 | 0o025 | NAK |  | Negative acknowledge |
| 22 | 0x16 | 00010110 | 0o026 | SYN |  | Synchronous idle |
| 23 | 0x17 | 00010111 | 0o027 | ETB |  | End of transmission block |
| 24 | 0x18 | 00011000 | 0o030 | CAN |  | Cancel |
| 25 | 0x19 | 00011001 | 0o031 | EM |  | End of medium |
| 26 | 0x1A | 00011010 | 0o032 | SUB |  | Substitute |
| 27 | 0x1B | 00011011 | 0o033 | ESC |  | Escape |
| 28 | 0x1C | 00011100 | 0o034 | FS |  | File separator |
| 29 | 0x1D | 00011101 | 0o035 | GS |  | Group separator |
| 30 | 0x1E | 00011110 | 0o036 | RS |  | Record separator |
| 31 | 0x1F | 00011111 | 0o037 | US |  | Unit separator |
| 127 | 0x7F | 01111111 | 0o177 | DEL |  | Delete |
The ones that still matter
- 9 (HT) — tab, still used for indentation and TSV files.
- 10 (LF) — line feed, the newline on Unix, macOS and inside HTTP and most network protocols.
- 13 (CR) — carriage return. Windows uses CR+LF, which is why files moved between systems show stray
^Mcharacters or collapse into a single line. - 27 (ESC) — starts every ANSI escape sequence, which is how terminals do colour and cursor movement.
- 0 (NUL) — the string terminator in C. Injecting it into text handled by C libraries is a classic truncation attack.
- 7 (BEL) — still makes most terminals beep.
Printable characters (32–126)
These 95 characters are the ones you can type and see. Every keyboard, font and protocol supports them, which is why they form the safe common denominator for identifiers, URLs and file formats.
| Dec | Hex | Binary | Octal | Char | HTML | Description |
|---|---|---|---|---|---|---|
| 32 | 0x20 | 00100000 | 0o040 | SP |   | Space |
| 33 | 0x21 | 00100001 | 0o041 | ! | ! | Exclamation mark |
| 34 | 0x22 | 00100010 | 0o042 | " | " | Double quote |
| 35 | 0x23 | 00100011 | 0o043 | # | # | Number sign / hash |
| 36 | 0x24 | 00100100 | 0o044 | $ | $ | Dollar sign |
| 37 | 0x25 | 00100101 | 0o045 | % | % | Percent sign |
| 38 | 0x26 | 00100110 | 0o046 | & | & | Ampersand |
| 39 | 0x27 | 00100111 | 0o047 | ' | ' | Apostrophe |
| 40 | 0x28 | 00101000 | 0o050 | ( | ( | Left parenthesis |
| 41 | 0x29 | 00101001 | 0o051 | ) | ) | Right parenthesis |
| 42 | 0x2A | 00101010 | 0o052 | * | * | Asterisk |
| 43 | 0x2B | 00101011 | 0o053 | + | + | Plus sign |
| 44 | 0x2C | 00101100 | 0o054 | , | , | Comma |
| 45 | 0x2D | 00101101 | 0o055 | - | - | Hyphen-minus |
| 46 | 0x2E | 00101110 | 0o056 | . | . | Full stop |
| 47 | 0x2F | 00101111 | 0o057 | / | / | Solidus / slash |
| 48 | 0x30 | 00110000 | 0o060 | 0 | 0 | Digit 0 |
| 49 | 0x31 | 00110001 | 0o061 | 1 | 1 | Digit 1 |
| 50 | 0x32 | 00110010 | 0o062 | 2 | 2 | Digit 2 |
| 51 | 0x33 | 00110011 | 0o063 | 3 | 3 | Digit 3 |
| 52 | 0x34 | 00110100 | 0o064 | 4 | 4 | Digit 4 |
| 53 | 0x35 | 00110101 | 0o065 | 5 | 5 | Digit 5 |
| 54 | 0x36 | 00110110 | 0o066 | 6 | 6 | Digit 6 |
| 55 | 0x37 | 00110111 | 0o067 | 7 | 7 | Digit 7 |
| 56 | 0x38 | 00111000 | 0o070 | 8 | 8 | Digit 8 |
| 57 | 0x39 | 00111001 | 0o071 | 9 | 9 | Digit 9 |
| 58 | 0x3A | 00111010 | 0o072 | : | : | Colon |
| 59 | 0x3B | 00111011 | 0o073 | ; | ; | Semicolon |
| 60 | 0x3C | 00111100 | 0o074 | < | < | Less-than sign |
| 61 | 0x3D | 00111101 | 0o075 | = | = | Equals sign |
| 62 | 0x3E | 00111110 | 0o076 | > | > | Greater-than sign |
| 63 | 0x3F | 00111111 | 0o077 | ? | ? | Question mark |
| 64 | 0x40 | 01000000 | 0o100 | @ | @ | Commercial at |
| 65 | 0x41 | 01000001 | 0o101 | A | A | Uppercase A |
| 66 | 0x42 | 01000010 | 0o102 | B | B | Uppercase B |
| 67 | 0x43 | 01000011 | 0o103 | C | C | Uppercase C |
| 68 | 0x44 | 01000100 | 0o104 | D | D | Uppercase D |
| 69 | 0x45 | 01000101 | 0o105 | E | E | Uppercase E |
| 70 | 0x46 | 01000110 | 0o106 | F | F | Uppercase F |
| 71 | 0x47 | 01000111 | 0o107 | G | G | Uppercase G |
| 72 | 0x48 | 01001000 | 0o110 | H | H | Uppercase H |
| 73 | 0x49 | 01001001 | 0o111 | I | I | Uppercase I |
| 74 | 0x4A | 01001010 | 0o112 | J | J | Uppercase J |
| 75 | 0x4B | 01001011 | 0o113 | K | K | Uppercase K |
| 76 | 0x4C | 01001100 | 0o114 | L | L | Uppercase L |
| 77 | 0x4D | 01001101 | 0o115 | M | M | Uppercase M |
| 78 | 0x4E | 01001110 | 0o116 | N | N | Uppercase N |
| 79 | 0x4F | 01001111 | 0o117 | O | O | Uppercase O |
| 80 | 0x50 | 01010000 | 0o120 | P | P | Uppercase P |
| 81 | 0x51 | 01010001 | 0o121 | Q | Q | Uppercase Q |
| 82 | 0x52 | 01010010 | 0o122 | R | R | Uppercase R |
| 83 | 0x53 | 01010011 | 0o123 | S | S | Uppercase S |
| 84 | 0x54 | 01010100 | 0o124 | T | T | Uppercase T |
| 85 | 0x55 | 01010101 | 0o125 | U | U | Uppercase U |
| 86 | 0x56 | 01010110 | 0o126 | V | V | Uppercase V |
| 87 | 0x57 | 01010111 | 0o127 | W | W | Uppercase W |
| 88 | 0x58 | 01011000 | 0o130 | X | X | Uppercase X |
| 89 | 0x59 | 01011001 | 0o131 | Y | Y | Uppercase Y |
| 90 | 0x5A | 01011010 | 0o132 | Z | Z | Uppercase Z |
| 91 | 0x5B | 01011011 | 0o133 | [ | [ | Left square bracket |
| 92 | 0x5C | 01011100 | 0o134 | \ | \ | Reverse solidus / backslash |
| 93 | 0x5D | 01011101 | 0o135 | ] | ] | Right square bracket |
| 94 | 0x5E | 01011110 | 0o136 | ^ | ^ | Circumflex accent |
| 95 | 0x5F | 01011111 | 0o137 | _ | _ | Low line / underscore |
| 96 | 0x60 | 01100000 | 0o140 | ` | ` | Grave accent |
| 97 | 0x61 | 01100001 | 0o141 | a | a | Lowercase a |
| 98 | 0x62 | 01100010 | 0o142 | b | b | Lowercase b |
| 99 | 0x63 | 01100011 | 0o143 | c | c | Lowercase c |
| 100 | 0x64 | 01100100 | 0o144 | d | d | Lowercase d |
| 101 | 0x65 | 01100101 | 0o145 | e | e | Lowercase e |
| 102 | 0x66 | 01100110 | 0o146 | f | f | Lowercase f |
| 103 | 0x67 | 01100111 | 0o147 | g | g | Lowercase g |
| 104 | 0x68 | 01101000 | 0o150 | h | h | Lowercase h |
| 105 | 0x69 | 01101001 | 0o151 | i | i | Lowercase i |
| 106 | 0x6A | 01101010 | 0o152 | j | j | Lowercase j |
| 107 | 0x6B | 01101011 | 0o153 | k | k | Lowercase k |
| 108 | 0x6C | 01101100 | 0o154 | l | l | Lowercase l |
| 109 | 0x6D | 01101101 | 0o155 | m | m | Lowercase m |
| 110 | 0x6E | 01101110 | 0o156 | n | n | Lowercase n |
| 111 | 0x6F | 01101111 | 0o157 | o | o | Lowercase o |
| 112 | 0x70 | 01110000 | 0o160 | p | p | Lowercase p |
| 113 | 0x71 | 01110001 | 0o161 | q | q | Lowercase q |
| 114 | 0x72 | 01110010 | 0o162 | r | r | Lowercase r |
| 115 | 0x73 | 01110011 | 0o163 | s | s | Lowercase s |
| 116 | 0x74 | 01110100 | 0o164 | t | t | Lowercase t |
| 117 | 0x75 | 01110101 | 0o165 | u | u | Lowercase u |
| 118 | 0x76 | 01110110 | 0o166 | v | v | Lowercase v |
| 119 | 0x77 | 01110111 | 0o167 | w | w | Lowercase w |
| 120 | 0x78 | 01111000 | 0o170 | x | x | Lowercase x |
| 121 | 0x79 | 01111001 | 0o171 | y | y | Lowercase y |
| 122 | 0x7A | 01111010 | 0o172 | z | z | Lowercase z |
| 123 | 0x7B | 01111011 | 0o173 | { | { | Left curly brace |
| 124 | 0x7C | 01111100 | 0o174 | | | | | Vertical line / pipe |
| 125 | 0x7D | 01111101 | 0o175 | } | } | Right curly brace |
| 126 | 0x7E | 01111110 | 0o176 | ~ | ~ | Tilde |
Patterns worth memorising
The ASCII layout is not arbitrary. Several deliberate design choices make character manipulation cheap in code:
- Digits start at 48.
'7' - '0'gives the numeric value 7. This is whychar - 48appears in so much parsing code. - Case differs by exactly 32. Uppercase A is 65, lowercase a is 97. Since 32 is 25, flipping bit 5 toggles case:
c ^ 32.c | 32forces lowercase andc & ~32forces uppercase. - Letters are contiguous. A–Z run 65–90 and a–z run 97–122 with no gaps, so range checks work. EBCDIC, the IBM alternative, did not have this property and was far more painful to program against.
- Control characters come first. Any byte under 32 is non-printing, so a single comparison filters them.
Apply these to real text with the text to binary converter, which shows the code point, binary and byte values of every character you type.
A short history
ASCII — the American Standard Code for Information Interchange — was published by the American Standards Association in 1963 and revised in 1967 and 1986. Before it, every manufacturer used its own encoding, and moving data between an IBM machine and anything else required a translation table.
The committee chose 7 bits, giving 128 codes. Seven was a compromise: six bits could not fit both cases plus digits and punctuation, and eight would have wasted expensive memory and transmission time. The eighth bit was commonly used as a parity check on serial lines.
That decision echoes today. UTF-8 was designed so that the 128 ASCII codes encode as single bytes with identical values, which means every ASCII file is already a valid UTF-8 file. Sixty years on, the table below is still the foundation of Unicode and therefore of essentially all digital text.
Extended ASCII and why it is ambiguous
“Extended ASCII” refers to codes 128–255, and the phrase is misleading because there is no single extended ASCII. Dozens of incompatible extensions filled that range:
| Encoding | Covers | Notes |
|---|---|---|
| ISO-8859-1 (Latin-1) | Western European | The historical default for HTTP and early HTML |
| Windows-1252 | Western European | Latin-1 plus curly quotes and the euro sign in 128–159 |
| ISO-8859-2 | Central European | Polish, Czech, Hungarian |
| ISO-8859-5 | Cyrillic | Russian, Bulgarian, Serbian |
| KOI8-R | Cyrillic | Ordered so that stripping bit 7 leaves readable transliteration |
| Code page 437 | IBM PC | Box-drawing characters used for text-mode interfaces |
The same byte meant different characters in each, which is the root cause of mojibake — text turned to garbage by being decoded with the wrong table. Unicode and UTF-8 exist to end this, and a page that declares <meta charset="utf-8"> never has the problem. Our character encoding guide traces the whole story.
Frequently Asked Questions
What is the ASCII value of A?
Uppercase A is 65 (0x41, binary 01000001). Lowercase a is 97 (0x61, binary 01100001).
How many characters are in ASCII?
128, numbered 0 to 127. Of those, 95 are printable and 33 are control characters (0–31 plus 127).
Why is ASCII 7-bit?
It was a compromise between coverage and cost. Six bits could not fit both letter cases plus digits and punctuation; eight would have wasted memory and bandwidth. The eighth bit was often used for parity.
What is the difference between ASCII and UTF-8?
UTF-8 is a superset. The 128 ASCII characters encode identically as single bytes, so every ASCII file is valid UTF-8, but UTF-8 continues with 2 to 4 byte sequences to cover all of Unicode.
How do I convert an ASCII code to a character?
In JavaScript String.fromCharCode(65), in Python chr(65), in C just cast the integer. Reverse with charCodeAt() or ord().
What is extended ASCII?
An informal name for codes 128–255, which ASCII never defined. Many incompatible encodings filled that range, which is why the same byte can render as different characters in different systems.
Why does uppercase differ from lowercase by 32?
It was a deliberate design choice. 32 is 2⁵, so a single bit distinguishes case and toggling it converts between them — a meaningful optimisation in 1963 hardware.
Sources & further reading
- Unicode: C0 Controls and Basic Latin — the official chart for code points U+0000 to U+007F
- RFC 20 — ASCII as adopted for use in network interchange, 1969
- Wikipedia: ASCII — committee history and the 1963/1967/1986 revisions
- Wikipedia: Mojibake — what happens when the wrong extended-ASCII table is applied