ASCII Table
All 128 ASCII codes in binary, decimal and hex. Click any value to copy it, or look up a letter, a code or a word.
Key facts
- “A” is 65: 01000001 in binary and 0x41 in hex. “a” is 97 (01100001): small letters are 32 higher, one bit.
ASCII character
A= 65
Uppercase A
0100 0001 4 1 (0x41) · ASCII uses 7 bits, so the first is always 0
- Decimal65
- Hex0x41
- Binary01000001
- Octal101
- HTMLA
- UnicodeU+0041
- Escape\x41
- URL%41
ASCII table, 0–127
0–31 · Control codes000xxxxx
| Char | Dec | Hex | Binary |
|---|---|---|---|
| 0 | 00 | 00000000 | |
| 1 | 01 | 00000001 | |
| 2 | 02 | 00000010 | |
| 3 | 03 | 00000011 | |
| 4 | 04 | 00000100 | |
| 5 | 05 | 00000101 | |
| 6 | 06 | 00000110 | |
| 7 | 07 | 00000111 | |
| 8 | 08 | 00001000 | |
| 9 | 09 | 00001001 | |
| 10 | 0A | 00001010 | |
| 11 | 0B | 00001011 | |
| 12 | 0C | 00001100 | |
| 13 | 0D | 00001101 | |
| 14 | 0E | 00001110 | |
| 15 | 0F | 00001111 | |
| 16 | 10 | 00010000 | |
| 17 | 11 | 00010001 | |
| 18 | 12 | 00010010 | |
| 19 | 13 | 00010011 | |
| 20 | 14 | 00010100 | |
| 21 | 15 | 00010101 | |
| 22 | 16 | 00010110 | |
| 23 | 17 | 00010111 | |
| 24 | 18 | 00011000 | |
| 25 | 19 | 00011001 | |
| 26 | 1A | 00011010 | |
| 27 | 1B | 00011011 | |
| 28 | 1C | 00011100 | |
| 29 | 1D | 00011101 | |
| 30 | 1E | 00011110 | |
| 31 | 1F | 00011111 |
32–63 · Symbols and digits001xxxxx
| Char | Dec | Hex | Binary |
|---|---|---|---|
| 32 | 20 | 00100000 | |
| 33 | 21 | 00100001 | |
| 34 | 22 | 00100010 | |
| 35 | 23 | 00100011 | |
| 36 | 24 | 00100100 | |
| 37 | 25 | 00100101 | |
| 38 | 26 | 00100110 | |
| 39 | 27 | 00100111 | |
| 40 | 28 | 00101000 | |
| 41 | 29 | 00101001 | |
| 42 | 2A | 00101010 | |
| 43 | 2B | 00101011 | |
| 44 | 2C | 00101100 | |
| 45 | 2D | 00101101 | |
| 46 | 2E | 00101110 | |
| 47 | 2F | 00101111 | |
| 48 | 30 | 00110000 | |
| 49 | 31 | 00110001 | |
| 50 | 32 | 00110010 | |
| 51 | 33 | 00110011 | |
| 52 | 34 | 00110100 | |
| 53 | 35 | 00110101 | |
| 54 | 36 | 00110110 | |
| 55 | 37 | 00110111 | |
| 56 | 38 | 00111000 | |
| 57 | 39 | 00111001 | |
| 58 | 3A | 00111010 | |
| 59 | 3B | 00111011 | |
| 60 | 3C | 00111100 | |
| 61 | 3D | 00111101 | |
| 62 | 3E | 00111110 | |
| 63 | 3F | 00111111 |
64–95 · Capital letters010xxxxx
| Char | Dec | Hex | Binary |
|---|---|---|---|
| 64 | 40 | 01000000 | |
| 65 | 41 | 01000001 | |
| 66 | 42 | 01000010 | |
| 67 | 43 | 01000011 | |
| 68 | 44 | 01000100 | |
| 69 | 45 | 01000101 | |
| 70 | 46 | 01000110 | |
| 71 | 47 | 01000111 | |
| 72 | 48 | 01001000 | |
| 73 | 49 | 01001001 | |
| 74 | 4A | 01001010 | |
| 75 | 4B | 01001011 | |
| 76 | 4C | 01001100 | |
| 77 | 4D | 01001101 | |
| 78 | 4E | 01001110 | |
| 79 | 4F | 01001111 | |
| 80 | 50 | 01010000 | |
| 81 | 51 | 01010001 | |
| 82 | 52 | 01010010 | |
| 83 | 53 | 01010011 | |
| 84 | 54 | 01010100 | |
| 85 | 55 | 01010101 | |
| 86 | 56 | 01010110 | |
| 87 | 57 | 01010111 | |
| 88 | 58 | 01011000 | |
| 89 | 59 | 01011001 | |
| 90 | 5A | 01011010 | |
| 91 | 5B | 01011011 | |
| 92 | 5C | 01011100 | |
| 93 | 5D | 01011101 | |
| 94 | 5E | 01011110 | |
| 95 | 5F | 01011111 |
96–127 · Small letters011xxxxx
| Char | Dec | Hex | Binary |
|---|---|---|---|
| 96 | 60 | 01100000 | |
| 97 | 61 | 01100001 | |
| 98 | 62 | 01100010 | |
| 99 | 63 | 01100011 | |
| 100 | 64 | 01100100 | |
| 101 | 65 | 01100101 | |
| 102 | 66 | 01100110 | |
| 103 | 67 | 01100111 | |
| 104 | 68 | 01101000 | |
| 105 | 69 | 01101001 | |
| 106 | 6A | 01101010 | |
| 107 | 6B | 01101011 | |
| 108 | 6C | 01101100 | |
| 109 | 6D | 01101101 | |
| 110 | 6E | 01101110 | |
| 111 | 6F | 01101111 | |
| 112 | 70 | 01110000 | |
| 113 | 71 | 01110001 | |
| 114 | 72 | 01110010 | |
| 115 | 73 | 01110011 | |
| 116 | 74 | 01110100 | |
| 117 | 75 | 01110101 | |
| 118 | 76 | 01110110 | |
| 119 | 77 | 01110111 | |
| 120 | 78 | 01111000 | |
| 121 | 79 | 01111001 | |
| 122 | 7A | 01111010 | |
| 123 | 7B | 01111011 | |
| 124 | 7C | 01111100 | |
| 125 | 7D | 01111101 | |
| 126 | 7E | 01111110 | |
| 127 | 7F | 01111111 |
Click any value to copy it. Each block shares its first three bits, so a row across the four blocks shares its last five: ^A, !, A and a all end in 00001.
How this works: Method, 8 sources, Checked against 10 worked examples,
How this works
Method
The table is generated from the codes themselves: each code is written in decimal, hex, octal and 8-bit binary, and the 33 control codes take their names from ANSI X3.4 and ECMA-6. Codes 128–255 are not ASCII; they are read from the published charts of three code pages (Windows-1252, ISO 8859-1 and DOS code page 437). HTML codes use the named entities of HTML 4.01 where one exists.
Sources
- ANSI X3.4-1986 (INCITS 4-1986), 7-Bit American Standard Code for Information Interchange (reaffirmed 2022, 1986)
- Ecma International, ECMA-6: 7-bit coded character set (6th edition, 1991)
- RFC 20, ASCII format for Network Interchange (1969)
- ISO/IEC 8859-1:1998, 8-bit single-byte coded graphic character sets, Part 1: Latin alphabet No. 1 (1998)
- Unicode Consortium, Microsoft cp1252 (Windows-1252) to Unicode table (2.01, 1998)
- Unicode Consortium, Microsoft cp437 (DOS Latin US) to Unicode table (2.00, 1996)
- Ecma International, ECMA-48: Control functions for coded character sets (5th edition, 1991)
- WHATWG Encoding Standard (windows-1252 labels) (Living Standard)
How it’s tested
10 worked examples for this page are checked by automated tests before every release: given the inputs, the tool must show the expected answer.
Changes
- Rebuilt around the table: 8-bit binary, click to copy, one lookup box, control codes explained, extended ASCII in three code pages and a printable chart.
- Added key facts about the most-used codes, such as A = 65 and the 32 gap between upper and lower case.
- Redesigned: a 16-column chart, each character’s byte shown as eight bits, a ranked search by character, code or name, and any text turned into its codes.
- Extended from 0–127 to the full 0–255 table with Latin-1, HTML entities, search and copy on click.
- First published.
ASCII control characters (0–31 and 127)
Thirty-three codes are not characters you see but instructions, from the days of teleprinters and paper tape. A few still do real work (tab, line feed, carriage return, escape); most survive as keyboard shortcuts. Caret notation is how terminals print them: Ctrl plus the key 64 above the code, so Ctrl+C sends 3.
| Dec | Hex | Code | Caret | Escape | What it does |
|---|---|---|---|---|---|
| 0 | 00 | NUL | ^@ | \0 | Null. Nothing: it fills space. C ends every string with it.^@ · \0 · 00000000 |
| 1 | 01 | SOH | ^A | \x01 | Start of Heading. Marked the start of a message’s heading (its address and routing) on a data link.^A · \x01 · 00000001 |
| 2 | 02 | STX | ^B | \x02 | Start of Text. Marked where a message’s heading ends and its text begins.^B · \x02 · 00000010 |
| 3 | 03 | ETX | ^C | \x03 | End of Text. Marked the end of the text. Ctrl+C sends it, and terminals use it to interrupt a program.^C · \x03 · 00000011 |
| 4 | 04 | EOT | ^D | \x04 | End of Transmission. Ended a transmission. Ctrl+D sends it, and Unix terminals read it as end of input.^D · \x04 · 00000100 |
| 5 | 05 | ENQ | ^E | \x05 | Enquiry. Asked the station at the other end to reply (to say who it is or how it is).^E · \x05 · 00000101 |
| 6 | 06 | ACK | ^F | \x06 | Acknowledge. A yes from the receiver: the data arrived.^F · \x06 · 00000110 |
| 7 | 07 | BEL | ^G | \a | Bell. Rings the terminal’s bell, or flashes the screen.^G · \a · 00000111 |
| 8 | 08 | BS | ^H | \b | Backspace. Moves back one position.^H · \b · 00001000 |
| 9 | 09 | HT | ^I | \t | Horizontal Tab. Moves to the next tab stop: the Tab key.^I · \t · 00001001 |
| 10 | 0A | LF | ^J | \n | Line Feed. Moves to the next line: the newline of C and Unix, written \n.^J · \n · 00001010 |
| 11 | 0B | VT | ^K | \v | Vertical Tab. Moves down to the next vertical tab stop. Rarely used today.^K · \v · 00001011 |
| 12 | 0C | FF | ^L | \f | Form Feed. Moves to the top of the next page on a printer.^L · \f · 00001100 |
| 13 | 0D | CR | ^M | \r | Carriage Return. Moves back to the start of the line. Email and HTTP end each line with CR then LF (13 10).^M · \r · 00001101 |
| 14 | 0E | SO | ^N | \x0e | Shift Out. Switched to another character set until Shift In.^N · \x0e · 00001110 |
| 15 | 0F | SI | ^O | \x0f | Shift In. Switched back to the standard character set.^O · \x0f · 00001111 |
| 16 | 10 | DLE | ^P | \x10 | Data Link Escape. Changed the meaning of the next few characters on a data link.^P · \x10 · 00010000 |
| 17 | 11 | DC1 | ^Q | \x11 | Device Control 1. XON: resume sending. Ctrl+Q sends it in a terminal.^Q · \x11 · 00010001 |
| 18 | 12 | DC2 | ^R | \x12 | Device Control 2. Switched a device on or into a special mode.^R · \x12 · 00010010 |
| 19 | 13 | DC3 | ^S | \x13 | Device Control 3. XOFF: pause sending. Ctrl+S sends it, which freezes many terminals until Ctrl+Q.^S · \x13 · 00010011 |
| 20 | 14 | DC4 | ^T | \x14 | Device Control 4. Switched a device off or stopped it.^T · \x14 · 00010100 |
| 21 | 15 | NAK | ^U | \x15 | Negative Acknowledge. A no from the receiver: the data arrived with errors.^U · \x15 · 00010101 |
| 22 | 16 | SYN | ^V | \x16 | Synchronous Idle. Kept a synchronous link in step when there was nothing else to send.^V · \x16 · 00010110 |
| 23 | 17 | ETB | ^W | \x17 | End of Transmission Block. Marked the end of a block of data.^W · \x17 · 00010111 |
| 24 | 18 | CAN | ^X | \x18 | Cancel. Said the data just sent is wrong and should be ignored.^X · \x18 · 00011000 |
| 25 | 19 | EM | ^Y | \x19 | End of Medium. Marked the end of the used part of a tape or card.^Y · \x19 · 00011001 |
| 26 | 1A | SUB | ^Z | \x1a | Substitute. Stands in for a character that was invalid or garbled. Ctrl+Z sends it.^Z · \x1a · 00011010 |
| 27 | 1B | ESC | ^[ | \x1b | Escape. Starts an escape sequence, such as the codes that colour terminal text (ESC [ 3 1 m is red).^[ · \x1b · 00011011 |
| 28 | 1C | FS | ^\ | \x1c | File Separator. Separates files: the largest of four nested separators.^\ · \x1c · 00011100 |
| 29 | 1D | GS | ^] | \x1d | Group Separator. Separates groups of records.^] · \x1d · 00011101 |
| 30 | 1E | RS | ^^ | \x1e | Record Separator. Separates records.^^ · \x1e · 00011110 |
| 31 | 1F | US | ^_ | \x1f | Unit Separator. Separates units (fields): the smallest of the four separators.^_ · \x1f · 00011111 |
| 127 | 7F | DEL | ^? | \x7f | Delete. Erased a character on punched paper tape by punching out every hole. Programs ignore it as data.^? · \x7f · 01111111 |
Names from ANSI X3.4-1986 and ECMA-6; what they did from RFC 20; the C escapes from the Linux ascii(7) manual (\x1b works for any code in C, JavaScript and Python); the terminal keys from termios(3); CR LF line ends from RFC 5322 (email) and RFC 9112 (HTTP); the terminal colour code from ECMA-48.
Extended ASCII (128–255): it depends on the code page
ASCII stops at 127. It is a 7-bit code, and the eighth bit of a byte was left to others, so there is no single “extended ASCII”: each code page filled 128–255 its own way. Three are common:
- Latin-1 (ISO/IEC 8859-1): accented letters and symbols from 160 to 255, with 128–159 kept for control codes. Its 256 values are the first 256 characters of Unicode.
- Windows-1252 (Microsoft, chart): Latin-1 with printable characters in 128–159, such as € at 128 and curly quotes at 145–148. Five bytes (129, 141, 143, 144, 157) are unused. Browsers decode pages labelled ISO-8859-1, Latin-1 and even US-ASCII as Windows-1252 (WHATWG Encoding Standard).
- Code page 437 (the IBM PC and DOS, chart): accented letters, box-drawing lines, shading blocks and Greek letters. This is the set many “extended ASCII” charts show.
| Byte | Windows-1252 | Latin-1 | DOS (CP437) |
|---|---|---|---|
| 128 · 80 | € | C1 | Ç |
| 147 · 93 | “ | STS | ô |
| 153 · 99 | ™ | C1 | Ö |
| 169 · A9 | © | © | ⌐ |
| 201 · C9 | É | É | ╔ |
| 233 · E9 | é | é | Θ |
| 219 · DB | Û | Û | █ |
| 241 · F1 | ñ | ñ | ± |
That is why old text shows the wrong letters: the bytes were written in one code page and read in another. Today, use UTF-8: the 128 ASCII codes stay the same single bytes, and every other character takes two to four (RFC 3629), so é is C3 A9. Every character has a Unicode code point; look them up in the Unicode code charts, or turn text into its UTF-8 bytes with text to binary.
All 128 extended codes in three code pagesEach byte from 128 to 255 in Windows-1252, Latin-1 and DOS
| Dec | Hex | Binary | Windows-1252 | Latin-1 | CP437 |
|---|---|---|---|---|---|
| 128 | 80 | 10000000 | € | C1 | Ç |
| 129 | 81 | 10000001 | — | C1 | ü |
| 130 | 82 | 10000010 | ‚ | BPH | é |
| 131 | 83 | 10000011 | ƒ | NBH | â |
| 132 | 84 | 10000100 | „ | C1 | ä |
| 133 | 85 | 10000101 | … | NEL | à |
| 134 | 86 | 10000110 | † | SSA | å |
| 135 | 87 | 10000111 | ‡ | ESA | ç |
| 136 | 88 | 10001000 | ˆ | HTS | ê |
| 137 | 89 | 10001001 | ‰ | HTJ | ë |
| 138 | 8A | 10001010 | Š | VTS | è |
| 139 | 8B | 10001011 | ‹ | PLD | ï |
| 140 | 8C | 10001100 | Œ | PLU | î |
| 141 | 8D | 10001101 | — | RI | ì |
| 142 | 8E | 10001110 | Ž | SS2 | Ä |
| 143 | 8F | 10001111 | — | SS3 | Å |
| 144 | 90 | 10010000 | — | DCS | É |
| 145 | 91 | 10010001 | ‘ | PU1 | æ |
| 146 | 92 | 10010010 | ’ | PU2 | Æ |
| 147 | 93 | 10010011 | “ | STS | ô |
| 148 | 94 | 10010100 | ” | CCH | ö |
| 149 | 95 | 10010101 | • | MW | ò |
| 150 | 96 | 10010110 | – | SPA | û |
| 151 | 97 | 10010111 | — | EPA | ù |
| 152 | 98 | 10011000 | ˜ | SOS | ÿ |
| 153 | 99 | 10011001 | ™ | C1 | Ö |
| 154 | 9A | 10011010 | š | SCI | Ü |
| 155 | 9B | 10011011 | › | CSI | ¢ |
| 156 | 9C | 10011100 | œ | ST | £ |
| 157 | 9D | 10011101 | — | OSC | ¥ |
| 158 | 9E | 10011110 | ž | PM | ₧ |
| 159 | 9F | 10011111 | Ÿ | APC | ƒ |
| 160 | A0 | 10100000 | á | ||
| 161 | A1 | 10100001 | ¡ | ¡ | í |
| 162 | A2 | 10100010 | ¢ | ¢ | ó |
| 163 | A3 | 10100011 | £ | £ | ú |
| 164 | A4 | 10100100 | ¤ | ¤ | ñ |
| 165 | A5 | 10100101 | ¥ | ¥ | Ñ |
| 166 | A6 | 10100110 | ¦ | ¦ | ª |
| 167 | A7 | 10100111 | § | § | º |
| 168 | A8 | 10101000 | ¨ | ¨ | ¿ |
| 169 | A9 | 10101001 | © | © | ⌐ |
| 170 | AA | 10101010 | ª | ª | ¬ |
| 171 | AB | 10101011 | « | « | ½ |
| 172 | AC | 10101100 | ¬ | ¬ | ¼ |
| 173 | AD | 10101101 | | | ¡ |
| 174 | AE | 10101110 | ® | ® | « |
| 175 | AF | 10101111 | ¯ | ¯ | » |
| 176 | B0 | 10110000 | ° | ° | ░ |
| 177 | B1 | 10110001 | ± | ± | ▒ |
| 178 | B2 | 10110010 | ² | ² | ▓ |
| 179 | B3 | 10110011 | ³ | ³ | │ |
| 180 | B4 | 10110100 | ´ | ´ | ┤ |
| 181 | B5 | 10110101 | µ | µ | ╡ |
| 182 | B6 | 10110110 | ¶ | ¶ | ╢ |
| 183 | B7 | 10110111 | · | · | ╖ |
| 184 | B8 | 10111000 | ¸ | ¸ | ╕ |
| 185 | B9 | 10111001 | ¹ | ¹ | ╣ |
| 186 | BA | 10111010 | º | º | ║ |
| 187 | BB | 10111011 | » | » | ╗ |
| 188 | BC | 10111100 | ¼ | ¼ | ╝ |
| 189 | BD | 10111101 | ½ | ½ | ╜ |
| 190 | BE | 10111110 | ¾ | ¾ | ╛ |
| 191 | BF | 10111111 | ¿ | ¿ | ┐ |
| 192 | C0 | 11000000 | À | À | └ |
| 193 | C1 | 11000001 | Á | Á | ┴ |
| 194 | C2 | 11000010 | Â | Â | ┬ |
| 195 | C3 | 11000011 | Ã | Ã | ├ |
| 196 | C4 | 11000100 | Ä | Ä | ─ |
| 197 | C5 | 11000101 | Å | Å | ┼ |
| 198 | C6 | 11000110 | Æ | Æ | ╞ |
| 199 | C7 | 11000111 | Ç | Ç | ╟ |
| 200 | C8 | 11001000 | È | È | ╚ |
| 201 | C9 | 11001001 | É | É | ╔ |
| 202 | CA | 11001010 | Ê | Ê | ╩ |
| 203 | CB | 11001011 | Ë | Ë | ╦ |
| 204 | CC | 11001100 | Ì | Ì | ╠ |
| 205 | CD | 11001101 | Í | Í | ═ |
| 206 | CE | 11001110 | Î | Î | ╬ |
| 207 | CF | 11001111 | Ï | Ï | ╧ |
| 208 | D0 | 11010000 | Ð | Ð | ╨ |
| 209 | D1 | 11010001 | Ñ | Ñ | ╤ |
| 210 | D2 | 11010010 | Ò | Ò | ╥ |
| 211 | D3 | 11010011 | Ó | Ó | ╙ |
| 212 | D4 | 11010100 | Ô | Ô | ╘ |
| 213 | D5 | 11010101 | Õ | Õ | ╒ |
| 214 | D6 | 11010110 | Ö | Ö | ╓ |
| 215 | D7 | 11010111 | × | × | ╫ |
| 216 | D8 | 11011000 | Ø | Ø | ╪ |
| 217 | D9 | 11011001 | Ù | Ù | ┘ |
| 218 | DA | 11011010 | Ú | Ú | ┌ |
| 219 | DB | 11011011 | Û | Û | █ |
| 220 | DC | 11011100 | Ü | Ü | ▄ |
| 221 | DD | 11011101 | Ý | Ý | ▌ |
| 222 | DE | 11011110 | Þ | Þ | ▐ |
| 223 | DF | 11011111 | ß | ß | ▀ |
| 224 | E0 | 11100000 | à | à | α |
| 225 | E1 | 11100001 | á | á | ß |
| 226 | E2 | 11100010 | â | â | Γ |
| 227 | E3 | 11100011 | ã | ã | π |
| 228 | E4 | 11100100 | ä | ä | Σ |
| 229 | E5 | 11100101 | å | å | σ |
| 230 | E6 | 11100110 | æ | æ | µ |
| 231 | E7 | 11100111 | ç | ç | τ |
| 232 | E8 | 11101000 | è | è | Φ |
| 233 | E9 | 11101001 | é | é | Θ |
| 234 | EA | 11101010 | ê | ê | Ω |
| 235 | EB | 11101011 | ë | ë | δ |
| 236 | EC | 11101100 | ì | ì | ∞ |
| 237 | ED | 11101101 | í | í | φ |
| 238 | EE | 11101110 | î | î | ε |
| 239 | EF | 11101111 | ï | ï | ∩ |
| 240 | F0 | 11110000 | ð | ð | ≡ |
| 241 | F1 | 11110001 | ñ | ñ | ± |
| 242 | F2 | 11110010 | ò | ò | ≥ |
| 243 | F3 | 11110011 | ó | ó | ≤ |
| 244 | F4 | 11110100 | ô | ô | ⌠ |
| 245 | F5 | 11110101 | õ | õ | ⌡ |
| 246 | F6 | 11110110 | ö | ö | ÷ |
| 247 | F7 | 11110111 | ÷ | ÷ | ≈ |
| 248 | F8 | 11111000 | ø | ø | ° |
| 249 | F9 | 11111001 | ù | ù | ∙ |
| 250 | FA | 11111010 | ú | ú | · |
| 251 | FB | 11111011 | û | û | √ |
| 252 | FC | 11111100 | ü | ü | ⁿ |
| 253 | FD | 11111101 | ý | ý | ² |
| 254 | FE | 11111110 | þ | þ | ■ |
| 255 | FF | 11111111 | ÿ | ÿ |
Why A is 65: reading ASCII in binary
The codes were laid out so that the bits do useful work. Read the binary column and four patterns stand out.
- Letters count from 1. Capitals start at 64 + 1, so the last five bits of A are 00001 (1), of B 00010 (2), up to Z, 11010 (26).
- Case is one bit. Small letters are 32 higher: A is 01000001 and a is 01100001. Only the bit worth 32 differs, so flipping it changes case.
- Digits carry their value. 0 to 9 are 48 to 57, 0011 then the digit in four bits: 7 is 00110111. Subtract 48 to get the number.
- Ctrl clears a bit. Ctrl+A is 1 and Ctrl+[ is 27 (Escape): the control code is the key’s code minus 64. That is why the four blocks line up, and why a row in the table pairs ^A, !, A and a.
Frequently Asked Questions
What is the ASCII code for @?
The at sign @ is 64 in decimal: 0x40 in hex, 01000000 in binary and 100 in octal. In HTML you can write it as @. It sits just before A (65), because the capital letters start at 64 + 1.
Why is A 65 in ASCII?
The capitals start at 64 + 1 so that the last five bits count the letters: A is 01000001 (1), B is 01000010 (2), up to Z at 90. Small letters are exactly 32 higher (a is 97), so upper and lower case differ by one bit.
What is the ASCII code for a space?
A space is 32: 0x20 in hex and 00100000 in binary. It is the first printable code; everything below it is a control code. The no-break space ( ) is a different character, 160 in Latin-1 and Windows-1252.
What is the difference between ASCII and Unicode?
ASCII has 128 codes (7 bits): English letters, digits, punctuation and 33 control codes. Unicode gives a number (a code point) to every character in every writing system, more than 150,000 of them, and its first 128 code points are ASCII. UTF-8, the usual way to store Unicode, keeps those 128 as the same single bytes, so plain ASCII text is already valid UTF-8; every other character takes two to four bytes.
What is extended ASCII?
Codes 128 to 255, which use the eighth bit of a byte. They are not part of ASCII and there is no single standard: each code page fills them its own way. Byte 128 is € in Windows-1252, a control code in Latin-1 (ISO 8859-1) and Ç in DOS code page 437. Switch the table to Extended to see each one.
Is ASCII 7-bit or 8-bit?
ASCII is a 7-bit code (0 to 127). Computers store it in 8-bit bytes with the first bit set to 0, which is why this table shows 8 bits: A is 01000001. RFC 20 describes exactly this: 7-bit ASCII in an 8-bit byte whose high-order bit is always 0.
What are ASCII control characters?
Codes 0 to 31 and 127 are 33 control characters: instructions for teleprinters and terminals rather than symbols. A few still matter: tab (9), line feed (10, the \n newline), carriage return (13, \r) and escape (27), which starts terminal colour codes. Most survive as keyboard shortcuts, such as Ctrl+C (3) and Ctrl+D (4).
How do I get the ASCII code of a character in code?
In Python, ord('A') gives 65 and chr(65) gives 'A'; format(65, '08b') gives 01000001. In JavaScript, 'A'.charCodeAt(0) gives 65 and String.fromCharCode(65) gives 'A'. In C a char already holds its code, so (int)'A' is 65.