
Last checked by the TextEditor.com team
What is ASCII?
ASCII stands for American Standard Code for Information Interchange. People say it "ASS-kee". It is a list of 128 codes, numbered 0 to 127. Each number stands for one letter, digit, sign or control action. The letter A is 65, a space is 32 and the digit 7 is 55.
Work on it started in 1961 with a proposal by IBM engineer Bob Bemer. A committee of the American Standards Association published the first version in 1963. Every code fits in 7 bits. Teleprinters before it used a 5 bit code called ITA2, which had room for only 32 codes. It had to switch between a letter set and a figure set. For even older text codes, see our page of symbol alphabets like Morse and Braille. You can read the full history in the ASCII article on Wikipedia.
1963
First ASCII standard
Capital letters, digits, signs and control codes. The spots for small letters were still empty.
1967
The big update
This is the version still in use, with small letters at 97 to 122.
1981
IBM PC and code page 437
Codes 128 to 255 get accented letters, Greek letters and box drawing lines.
1987
ISO 8859-1
A shared upper half for Western European languages.
1991
Unicode 1.0
One number for every character. The first 128 are ASCII.
1993
UTF-8 presented
Stores ASCII as one byte and everything else as 2 to 4 bytes.
2008
UTF-8 leads the web
It becomes the most common text encoding on web pages.
How to read the ASCII table
Each row shows one number written four ways. Decimal is the normal way to count, with ten digits. Hex, short for hexadecimal, uses 16 digits: 0 to 9 and then A to F. Octal uses 8 digits. Binary uses only 0 and 1, which is how the computer stores it.
So the letter A is 65 in decimal, 41 in hex, 101 in octal and 1000001 in binary. All four are the same number. Programmers like hex because two hex digits always make one byte of 8 bits.
| Decimal | 65 | 6 × 10 + 5 |
|---|---|---|
| Hex | 41 | 4 × 16 + 1 |
| Octal | 101 | 1 × 64 + 0 × 8 + 1 |
| Binary | 1000001 | 64 + 1 |
Each switch is one bit. Add up the values of the bits that are on, and you get the code.
The chart view of the table uses hex too. The row is the first hex digit and the column is the second. A sits in row 4, column 1, so its hex code is 41.
Why uppercase and lowercase are 32 apart
A is 65 and a is 97. The gap is 32, and 32 is one single bit in binary. It is called bit 5, counting from 0 on the right. Capital letters have this bit off. Small letters have it on. Flip that one bit and the letter changes case.
This was planned. The committee put the small letters exactly one bit away from the capitals. That made keyboards and printers simpler to build, and it made it easy to compare text without caring about case.
| Letter | Code | Binary | Bit 5 flipped | New code | Result |
|---|---|---|---|---|---|
| H | 72 | 1001000 | 1101000 | 104 | h |
| e | 101 | 1100101 | 1000101 | 69 | E |
| l | 108 | 1101100 | 1001100 | 76 | L |
| l | 108 | 1101100 | 1001100 | 76 | L |
| o | 111 | 1101111 | 1001111 | 79 | O |
The bold digit is bit 5. Only letters are flipped. For a digit or a sign, the same flip gives a different symbol or a control code.
Digits have a trick of their own. The digits 0 to 9 sit at codes 48 to 57, so a digit's value is its code minus 48. In hex they are 30 to 39, and the last hex digit is the digit itself.
Control characters: the invisible 33
Codes 0 to 31 and code 127 do not print anything. They are commands. They told teletypes and printers to start a new line, to move back or to stop. The Teletype Model 33 even had a real bell that rang when it got code 7, BEL.
You can type each one with the Ctrl key. Ctrl plus a letter gives that letter's code minus 64. So Ctrl+G is 7, the bell. Ctrl+H is 8, backspace. Ctrl+M is 13, carriage return. Terminals still show these codes as ^G, ^H and ^M.
Most control codes are history now. These are the ones you still meet today:
| Code | Name | Where you meet it |
|---|---|---|
| 9 | HT Horizontal Tab | The Tab key. Also splits columns in tab separated files (TSV). |
| 10 | LF Line Feed | Ends every line in Linux and macOS files and in most web text. |
| 13 | CR Carriage Return | The Enter key. Windows files end lines with CR LF (13 10). |
| 27 | ESC Escape | The Esc key. Terminal color codes start with it. |
| 8 | BS Backspace | Backspace in terminals and some old keyboards. |
| 0 | NUL Null | Marks the end of a string in C. Also fills empty space in files. |
| 127 | DEL Delete | Sent by the Backspace key in many Linux and macOS terminals. |
The names CR and LF come from typewriters. Carriage return moved the print head back to the left side. Line feed rolled the paper up one line. Windows still ends each line with both. Linux and macOS use LF alone. That is why a file from one system can show up as one long line on the other.
Printable characters from space to tilde
Codes 32 to 126 are the 95 printable characters. The space comes first and the tilde (~) comes last. Every key on a US keyboard is in this range. The chart below colors them by group. Click one to copy it.
| First hex digit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2 | ||||||||||||||||
| 3 | ||||||||||||||||
| 4 | ||||||||||||||||
| 5 | ||||||||||||||||
| 6 | ||||||||||||||||
| 7 |
Symbols and space: 33Digits: 10Capital letters: 26Small letters: 26Delete, a control code: 1
The 32 symbols are the ones password rules mean when they ask for "a special character". Our password generator can add them for you.
What is extended ASCII?
ASCII uses 7 bits, but computers store text in bytes of 8 bits. That leaves 128 more codes, from 128 to 255. ASCII never said what goes there, so each maker filled them in its own way. Each of these sets is called a code page.
The first IBM PC came with code page 437. It has accented letters, Greek letters and the box drawing lines that old DOS programs used to draw windows. You can still copy those box drawing characters or use them in text frames. ISO 8859-1 holds accented letters for Western European languages. Windows-1252 is almost the same, but it also fills 128 to 159 with curly quotes, the euro sign and a few more.
So "extended ASCII" is not one standard. The same byte shows a different character on each code page.
| Code page | Character |
|---|---|
| Windows-1252 | é U+00E9 |
| ISO 8859-1 | é U+00E9 |
| Code page 437 | Θ U+0398 |
Byte 233 is E9 in hex and 11101001 in binary.
Alt codes on Windows show the same thing. On a US Windows PC, Alt+233 uses the old code page 437 and types Θ. Alt+0233, with the zero in front, uses Windows-1252 and types é.
All codes from 128 to 255
Not ASCII. These codes depend on the code page.
| Dec | Hex | Windows-1252 | ISO 8859-1 | Code page 437 |
|---|---|---|---|---|
| 128 | 80 | € U+20AC | control | Ç U+00C7 |
| 129 | 81 | unused | control | ü U+00FC |
| 130 | 82 | ‚ U+201A | control | é U+00E9 |
| 131 | 83 | ƒ U+0192 | control | â U+00E2 |
| 132 | 84 | „ U+201E | control | ä U+00E4 |
| 133 | 85 | … U+2026 | control | à U+00E0 |
| 134 | 86 | † U+2020 | control | å U+00E5 |
| 135 | 87 | ‡ U+2021 | control | ç U+00E7 |
| 136 | 88 | ˆ U+02C6 | control | ê U+00EA |
| 137 | 89 | ‰ U+2030 | control | ë U+00EB |
| 138 | 8A | Š U+0160 | control | è U+00E8 |
| 139 | 8B | ‹ U+2039 | control | ï U+00EF |
| 140 | 8C | Œ U+0152 | control | î U+00EE |
| 141 | 8D | unused | control | ì U+00EC |
| 142 | 8E | Ž U+017D | control | Ä U+00C4 |
| 143 | 8F | unused | control | Å U+00C5 |
| 144 | 90 | unused | control | É U+00C9 |
| 145 | 91 | ‘ U+2018 | control | æ U+00E6 |
| 146 | 92 | ’ U+2019 | control | Æ U+00C6 |
| 147 | 93 | “ U+201C | control | ô U+00F4 |
| 148 | 94 | ” U+201D | control | ö U+00F6 |
| 149 | 95 | • U+2022 | control | ò U+00F2 |
| 150 | 96 | en dash | control | û U+00FB |
| 151 | 97 | em dash | control | ù U+00F9 |
| 152 | 98 | ˜ U+02DC | control | ÿ U+00FF |
| 153 | 99 | ™ U+2122 | control | Ö U+00D6 |
| 154 | 9A | š U+0161 | control | Ü U+00DC |
| 155 | 9B | › U+203A | control | ¢ U+00A2 |
| 156 | 9C | œ U+0153 | control | £ U+00A3 |
| 157 | 9D | unused | control | ¥ U+00A5 |
| 158 | 9E | ž U+017E | control | ₧ U+20A7 |
| 159 | 9F | Ÿ U+0178 | control | ƒ U+0192 |
| 160 | A0 | NBSP | NBSP | á U+00E1 |
| 161 | A1 | ¡ U+00A1 | ¡ U+00A1 | í U+00ED |
| 162 | A2 | ¢ U+00A2 | ¢ U+00A2 | ó U+00F3 |
| 163 | A3 | £ U+00A3 | £ U+00A3 | ú U+00FA |
| 164 | A4 | ¤ U+00A4 | ¤ U+00A4 | ñ U+00F1 |
| 165 | A5 | ¥ U+00A5 | ¥ U+00A5 | Ñ U+00D1 |
| 166 | A6 | ¦ U+00A6 | ¦ U+00A6 | ª U+00AA |
| 167 | A7 | § U+00A7 | § U+00A7 | º U+00BA |
| 168 | A8 | ¨ U+00A8 | ¨ U+00A8 | ¿ U+00BF |
| 169 | A9 | © U+00A9 | © U+00A9 | ⌐ U+2310 |
| 170 | AA | ª U+00AA | ª U+00AA | ¬ U+00AC |
| 171 | AB | « U+00AB | « U+00AB | ½ U+00BD |
| 172 | AC | ¬ U+00AC | ¬ U+00AC | ¼ U+00BC |
| 173 | AD | SHY | SHY | ¡ U+00A1 |
| 174 | AE | ® U+00AE | ® U+00AE | « U+00AB |
| 175 | AF | ¯ U+00AF | ¯ U+00AF | » U+00BB |
| 176 | B0 | ° U+00B0 | ° U+00B0 | ░ U+2591 |
| 177 | B1 | ± U+00B1 | ± U+00B1 | ▒ U+2592 |
| 178 | B2 | ² U+00B2 | ² U+00B2 | ▓ U+2593 |
| 179 | B3 | ³ U+00B3 | ³ U+00B3 | │ U+2502 |
| 180 | B4 | ´ U+00B4 | ´ U+00B4 | ┤ U+2524 |
| 181 | B5 | µ U+00B5 | µ U+00B5 | ╡ U+2561 |
| 182 | B6 | ¶ U+00B6 | ¶ U+00B6 | ╢ U+2562 |
| 183 | B7 | · U+00B7 | · U+00B7 | ╖ U+2556 |
| 184 | B8 | ¸ U+00B8 | ¸ U+00B8 | ╕ U+2555 |
| 185 | B9 | ¹ U+00B9 | ¹ U+00B9 | ╣ U+2563 |
| 186 | BA | º U+00BA | º U+00BA | ║ U+2551 |
| 187 | BB | » U+00BB | » U+00BB | ╗ U+2557 |
| 188 | BC | ¼ U+00BC | ¼ U+00BC | ╝ U+255D |
| 189 | BD | ½ U+00BD | ½ U+00BD | ╜ U+255C |
| 190 | BE | ¾ U+00BE | ¾ U+00BE | ╛ U+255B |
| 191 | BF | ¿ U+00BF | ¿ U+00BF | ┐ U+2510 |
| 192 | C0 | À U+00C0 | À U+00C0 | └ U+2514 |
| 193 | C1 | Á U+00C1 | Á U+00C1 | ┴ U+2534 |
| 194 | C2 | Â U+00C2 | Â U+00C2 | ┬ U+252C |
| 195 | C3 | Ã U+00C3 | Ã U+00C3 | ├ U+251C |
| 196 | C4 | Ä U+00C4 | Ä U+00C4 | ─ U+2500 |
| 197 | C5 | Å U+00C5 | Å U+00C5 | ┼ U+253C |
| 198 | C6 | Æ U+00C6 | Æ U+00C6 | ╞ U+255E |
| 199 | C7 | Ç U+00C7 | Ç U+00C7 | ╟ U+255F |
| 200 | C8 | È U+00C8 | È U+00C8 | ╚ U+255A |
| 201 | C9 | É U+00C9 | É U+00C9 | ╔ U+2554 |
| 202 | CA | Ê U+00CA | Ê U+00CA | ╩ U+2569 |
| 203 | CB | Ë U+00CB | Ë U+00CB | ╦ U+2566 |
| 204 | CC | Ì U+00CC | Ì U+00CC | ╠ U+2560 |
| 205 | CD | Í U+00CD | Í U+00CD | ═ U+2550 |
| 206 | CE | Î U+00CE | Î U+00CE | ╬ U+256C |
| 207 | CF | Ï U+00CF | Ï U+00CF | ╧ U+2567 |
| 208 | D0 | Ð U+00D0 | Ð U+00D0 | ╨ U+2568 |
| 209 | D1 | Ñ U+00D1 | Ñ U+00D1 | ╤ U+2564 |
| 210 | D2 | Ò U+00D2 | Ò U+00D2 | ╥ U+2565 |
| 211 | D3 | Ó U+00D3 | Ó U+00D3 | ╙ U+2559 |
| 212 | D4 | Ô U+00D4 | Ô U+00D4 | ╘ U+2558 |
| 213 | D5 | Õ U+00D5 | Õ U+00D5 | ╒ U+2552 |
| 214 | D6 | Ö U+00D6 | Ö U+00D6 | ╓ U+2553 |
| 215 | D7 | × U+00D7 | × U+00D7 | ╫ U+256B |
| 216 | D8 | Ø U+00D8 | Ø U+00D8 | ╪ U+256A |
| 217 | D9 | Ù U+00D9 | Ù U+00D9 | ┘ U+2518 |
| 218 | DA | Ú U+00DA | Ú U+00DA | ┌ U+250C |
| 219 | DB | Û U+00DB | Û U+00DB | █ U+2588 |
| 220 | DC | Ü U+00DC | Ü U+00DC | ▄ U+2584 |
| 221 | DD | Ý U+00DD | Ý U+00DD | ▌ U+258C |
| 222 | DE | Þ U+00DE | Þ U+00DE | ▐ U+2590 |
| 223 | DF | ß U+00DF | ß U+00DF | ▀ U+2580 |
| 224 | E0 | à U+00E0 | à U+00E0 | α U+03B1 |
| 225 | E1 | á U+00E1 | á U+00E1 | ß U+00DF |
| 226 | E2 | â U+00E2 | â U+00E2 | Γ U+0393 |
| 227 | E3 | ã U+00E3 | ã U+00E3 | π U+03C0 |
| 228 | E4 | ä U+00E4 | ä U+00E4 | Σ U+03A3 |
| 229 | E5 | å U+00E5 | å U+00E5 | σ U+03C3 |
| 230 | E6 | æ U+00E6 | æ U+00E6 | µ U+00B5 |
| 231 | E7 | ç U+00E7 | ç U+00E7 | τ U+03C4 |
| 232 | E8 | è U+00E8 | è U+00E8 | Φ U+03A6 |
| 233 | E9 | é U+00E9 | é U+00E9 | Θ U+0398 |
| 234 | EA | ê U+00EA | ê U+00EA | Ω U+03A9 |
| 235 | EB | ë U+00EB | ë U+00EB | δ U+03B4 |
| 236 | EC | ì U+00EC | ì U+00EC | ∞ U+221E |
| 237 | ED | í U+00ED | í U+00ED | φ U+03C6 |
| 238 | EE | î U+00EE | î U+00EE | ε U+03B5 |
| 239 | EF | ï U+00EF | ï U+00EF | ∩ U+2229 |
| 240 | F0 | ð U+00F0 | ð U+00F0 | ≡ U+2261 |
| 241 | F1 | ñ U+00F1 | ñ U+00F1 | ± U+00B1 |
| 242 | F2 | ò U+00F2 | ò U+00F2 | ≥ U+2265 |
| 243 | F3 | ó U+00F3 | ó U+00F3 | ≤ U+2264 |
| 244 | F4 | ô U+00F4 | ô U+00F4 | ⌠ U+2320 |
| 245 | F5 | õ U+00F5 | õ U+00F5 | ⌡ U+2321 |
| 246 | F6 | ö U+00F6 | ö U+00F6 | ÷ U+00F7 |
| 247 | F7 | ÷ U+00F7 | ÷ U+00F7 | ≈ U+2248 |
| 248 | F8 | ø U+00F8 | ø U+00F8 | ° U+00B0 |
| 249 | F9 | ù U+00F9 | ù U+00F9 | ∙ U+2219 |
| 250 | FA | ú U+00FA | ú U+00FA | · U+00B7 |
| 251 | FB | û U+00FB | û U+00FB | √ U+221A |
| 252 | FC | ü U+00FC | ü U+00FC | ⁿ U+207F |
| 253 | FD | ý U+00FD | ý U+00FD | ² U+00B2 |
| 254 | FE | þ U+00FE | þ U+00FE | ■ U+25A0 |
| 255 | FF | ÿ U+00FF | ÿ U+00FF | NBSP |
On the first IBM PC, even the control codes 1 to 31 showed up as small pictures on screen, like ☺, ♥ and ♪. Code page 437 is the reason so much early text art looks the way it does.
ASCII vs Unicode and UTF-8
Unicode gives a number, called a code point, to every character in every script, plus emoji. Its first 128 code points, U+0000 to U+007F, are ASCII in the same order. Code point U+0041 is still the letter A.
UTF-8 is the usual way to store those code points as bytes. It writes each ASCII character as one byte with the same value as before, so a plain ASCII file is already a valid UTF-8 file. Other characters take 2 to 4 bytes. UTF-8 has been the most common encoding on the web since 2008.
| Char | ASCII code | Unicode | UTF-8 bytes (hex) | Bytes |
|---|---|---|---|---|
| C | 67 | U+0043 | 43 | 1 |
| a | 97 | U+0061 | 61 | 1 |
| f | 102 | U+0066 | 66 | 1 |
| é | none | U+00E9 | C3 A9 | 2 |
4 characters, 5 bytes. Read by mistake as Windows-1252, the same bytes show as Café
That last line has a name: mojibake, or garbled text. The é in "Café" is two bytes in UTF-8, C3 and A9. A program that reads them as Windows-1252 shows two characters, Ã and ©. Highlighted rows in the table are the characters that need more than one byte.
To type characters beyond ASCII, use the Unicode keyboard, or search every character in the character picker.
Convert text to ASCII codes and back
Use the two boxes at the top of this page. Type in the Text box to get codes. Paste codes in the other box to get text back. Pick decimal, hex, octal or binary, and how to separate the codes. If you paste codes like 0x48 or 01001000, the tool works out the base for you.
Binary converters usually show 8 bits per character, like 01000001 for A. ASCII needs only 7, so the first bit is always 0. The converter shows all 8, and the table above leaves the extra 0 out.
Characters outside ASCII, like é or an emoji, have no ASCII code. The converter shows their Unicode code point instead, such as U+00E9, and tells you which characters they are.
In code, every common language has a built in way to do this:
| Language | Character to code | Code to character |
|---|---|---|
| JavaScript | "A".charCodeAt(0) // 65 | String.fromCharCode(65) // "A" |
| Python | ord("A") # 65 | chr(65) # "A" |
| C | (int)'A' // 65 | (char)65 // 'A' |
| Excel | =CODE("A") | =CHAR(65) |
For characters beyond ASCII, use codePointAt and String.fromCodePoint in JavaScript. Python's ord and chr already work for all of Unicode.