| Dec | Hex | Alt | Esc | Character | Dec | Hex | Character | Dec | Hex | Character | Dec | Hex | Character |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 0x00 | Ctrl-@ | NUL (Null) | 32 | 0x20 | [Space] | 64 | 0x40 | @ | 96 | 0x60 | ` | |
| 1 | 0x01 | ☺ | Ctrl-A | SOH | 33 | 0x21 | ! | 65 | 0x41 | A | 97 | 0x61 | a |
| 2 | 0x02 | ☻ | Ctrl-B | STX | 34 | 0x22 | " | 66 | 0x42 | B | 98 | 0x62 | b |
| 3 | 0x03 | ♥ | Ctrl-C | ETX | 35 | 0x23 | # | 67 | 0x43 | C | 99 | 0x63 | c |
| 4 | 0x04 | ♦ | Ctrl-D | EOT | 36 | 0x24 | $ | 68 | 0x44 | D | 100 | 0x64 | d |
| 5 | 0x05 | ♣ | Ctrl-E | ENQ | 37 | 0x25 | % | 69 | 0x45 | E | 101 | 0x65 | e |
| 6 | 0x06 | ♠ | Ctrl-F | ACK | 38 | 0x26 | & | 70 | 0x46 | F | 102 | 0x66 | f |
| 7 | 0x07 | • | Ctrl-G | BEL | 39 | 0x27 | ' | 71 | 0x47 | G | 103 | 0x67 | g |
| 8 | 0x08 | ◘ | Ctrl-H | BS Backspace ⌫ | 40 | 0x28 | ( | 72 | 0x48 | H | 104 | 0x68 | h |
| 9 | 0x09 | ○しろまる | Ctrl-I | TAB "" \t | 41 | 0x29 | ) | 73 | 0x49 | I | 105 | 0x69 | i |
| 10 | 0x0A | ◙ | Ctrl-J | LF Line Feed \n | 42 | 0x2A | * | 74 | 0x4A | J | 106 | 0x6A | j |
| 11 | 0x0B | ♂ | Ctrl-K | VT | 43 | 0x2B | + | 75 | 0x4B | K | 107 | 0x6B | k |
| 12 | 0x0C | ♀ | Ctrl-L | FF Form Feed | 44 | 0x2C | , | 76 | 0x4C | L | 108 | 0x6C | l |
| 13 | 0x0D | ♪ | Ctrl‐M | CR Carriage Return \r | 45 | 0x2D | - | 77 | 0x4D | M | 109 | 0x6D | m |
| 14 | 0x0E | ♫ | Ctrl-N | SO | 46 | 0x2E | . | 78 | 0x4E | N | 110 | 0x6E | n |
| 15 | 0x0F | ☼ | Ctrl-O | SI | 47 | 0x2F | / | 79 | 0x4F | O | 111 | 0x6F | o |
| 16 | 0x10 | ► | Ctrl-P | DLE | 48 | 0x30 | 0 | 80 | 0x50 | P | 112 | 0x70 | p |
| 17 | 0x11 | ◄ | Ctrl-Q | DC1 | 49 | 0x31 | 1 | 81 | 0x51 | Q | 113 | 0x71 | q |
| 18 | 0x12 | ↕ | Ctrl-R | DC2 | 50 | 0x32 | 2 | 82 | 0x52 | R | 114 | 0x72 | r |
| 19 | 0x13 | !! | Ctrl-S | DC3 | 51 | 0x33 | 3 | 83 | 0x53 | S | 115 | 0x73 | s |
| 20 | 0x14 | ¶ | Ctrl-T | DC4 | 52 | 0x34 | 4 | 84 | 0x54 | T | 116 | 0x74 | t |
| 21 | 0x15 | § | Ctrl-U | NAK | 53 | 0x35 | 5 | 85 | 0x55 | U | 117 | 0x75 | u |
| 22 | 0x16 | ▬ | Ctrl-V | SYN | 54 | 0x36 | 6 | 86 | 0x56 | V | 118 | 0x76 | v |
| 23 | 0x17 | ↨ | Ctrl‐W | ETB | 55 | 0x37 | 7 | 87 | 0x57 | W | 119 | 0x77 | w |
| 24 | 0x18 | ↑ | Ctrl-X | CAN | 56 | 0x38 | 8 | 88 | 0x58 | X | 120 | 0x78 | x |
| 25 | 0x19 | ↓ | Ctrl-Y | EM | 57 | 0x39 | 9 | 89 | 0x59 | Y | 121 | 0x79 | y |
| 26 | 0x1A | → | Ctrl-Z | SUB (EOF) | 58 | 0x3A | : | 90 | 0x5A | Z | 122 | 0x7A | z |
| 27 | 0x1B | ← | Ctrl-[ | ESC (Escape) | 59 | 0x3B | ; | 91 | 0x5B | [ | 123 | 0x7B | { |
| 28 | 0x1C | ∟ | Ctrl-/ | FS | 60 | 0x3C | < | 92 | 0x5C | \ | 124 | 0x7C | | |
| 29 | 0x1D | ↔ | Ctrl-] | GS | 61 | 0x3D | = | 93 | 0x5D | ] | 125 | 0x7D | } |
| 30 | 0x1E | ▲さんかく | Ctrl-^ | RS | 62 | 0x3E | > | 94 | 0x5E | ^ | 126 | 0x7E | ~ |
| 31 | 0x1F | ▼ | Ctrl-_ | US | 63 | 0x3F | ? | 95 | 0x5F | _ | 127 | 0x7F | DEL |
ASCII is a 7 bit character encoding standard used to store characters and basic punctuation as numeric values.
ASCII codes from 0 - 127 are identical to Unicode. Adding 32 (or flipping the sixth bit) will convert an upper case letter to lower case.
Some 8-bit Extended ASCII codes from 128 - 256 are no longer in use because the original code pages varied by country/locale.
Below are the modern Unicode equivalents for the most common (Code Page 1252/ANSI) characters:
| Dec | Hex | Unicode Character | Dec | Hex | Unicode Character |
|---|---|---|---|---|---|
| 8220 | 0x201C | " | 174 | 0x00AE | ® |
| 8221 | 0x201D | " | 176 | 0x00B0 | ° (degree sign) |
| 8216 | 0x2018 | ‘ | 177 | 0x00B1 | ± |
| 8217 | 0x2019 | ’ | 178 | 0x00B2 | 2 (squared) |
| 8222 | 0x201E | „ | 179 | 0x00B3 | 3 (cubed) |
| 8218 | 0x201A | ‚ | 180 | 0x00B4 | ́ (acute) |
| 171 | 0x00AB | « | 181 | 0x00B5 | μ |
| 187 | 0x00BB | » | 182 | 0x00B6 | ¶ |
| 8249 | 0x2039 | ‹ | 188 | 0x00BC | 1⁄4 |
| 8250 | 0x203A | › | 189 | 0x00BD | 1⁄2 |
| 161 | 0x00A1 | ¡ (inverted !) | 190 | 0x00BE | 3⁄4 |
| 191 | 0x00BF | ¿ (inverted ?) | 198 | 0x00C6 | Æ |
| 402 | 0x0192 | ƒ (florin) | 230 | 0x00E6 | æ |
| 183 | 0x00B7 | · (interpunct) | 215 | 0x00D7 | ×ばつ (multiplication) |
| 8226 | 0x2022 | • (bullet) | 247 | 0x00F7 | ÷ (division) |
| 8211 | 0x2013 | – (en dash) | 960 |
0x03C0 |
π |
| 8212 | 0x2014 | — (em dash) | 8800 | 0x2260 | ≠ |
| 8470 | 0x2116 | No | 8942 | 0x22EE | ⋮ |
| 732 | 0x02DC | ̃ (small tilde) | 9617 | 0x2591 | ░ |
| 8482 | 0x2122 | TM | 9618 | 0x2592 | ▒ |
| 339 | 0x0153 | œ | 9619 | 0x2593 | ▓ |
| 255 | 0x00FF | ÿ | 9474 | 0x2502 | │ |
| 382 | 0x017E | ž | 9515 | 0x252B | ┫ |
| 162 | 0x00A2 | ¢ | 9472 | 0x2500 | ─ |
| 163 | 0x00A3 | £ | 9484 | 0x250C | ┌ |
| 8253 | 0x203D | ‽ (interrobang) | 9488 | 0x2510 | ┐ |
| 8364 | 0x20AC | € (Euro) | 9496 | 0x2518 | ┘ |
| 164 | 0x00A4 | ¤ (currency sign) | 9492 | 0x2514 | └ |
| 165 | 0x00A5 | \ (Yen) | 8730 | 0x221A | √ |
| 166 | 0x00A6 | ¦ | 8721 | 0x2211 | ∑ (N-Sum) |
| 167 | ox00A7 | § (Section Sign) | 8734 | 0x221E | ∞ |
| 169 | 0x00A9 | © | 8801 | 0x2261 | ≡ (identical) |
All of these Extended ASCII characters may be used in file and folder names under NTFS (Windows) or APFS (Mac).
Although these 8-bit code pages are often referred to as "ANSI" characters by Microsoft, they were based on a draft ANSI paper which was never standardized. The code page Windows-1252 is similar to ISO 8859-1 (Latin-1), but is not an exact match.
一 Windows CR+LF Line Ending is Chr(13) followed by Chr(10), in PowerShell `r`n.
一 Linux and MacOS LF Line Ending is Chr(10)—very early versions of Mac OSX did use CR/Chr(13).
In Windows, hold down the ALT key, and type the code:
e.g. press ALT + on the numeric keypad 9+3, then release ALT to produce a ']' which is ASCII code 93.
This does not work for extended ASCII codes above 255, the value will be mod 256 or mod 65,536 in a RichEdit control.In xterm you can send key combinations using the hex value, so to send Esc: \x1B
The control codes from 1 to 31 are not normally visible, so on Windows when entered using an ALT+No., they will be auto-replaced with the Alt characters shown in the first table above.
e.g. press ALT + on the numeric keypad 1, then release ALT to get ASCII code 1, which will display as ☺ (Unicode U+263A).Control codes can be also entered using an Esc or Ctrl key combination, e.g. Ctrl+H will backspace over the last character typed. These keys work under most Operating Systems, but under Windows Ctrl+M will enter or exit 'Mark Mode' rather than produce the expected CR/Carriage Return. You may notice that these Ctrl Key shortcuts match the 3rd column of ASCII codes in the table.
The Control key clears the top 3 binary bits of whatever character you type, mapping the bottom five bits to the 0..31 range.
So, for example, Ctrl-SPACE, Ctrl-@, and Ctrl-` all mean the same thing: NUL.
"Why shouldn’t we give our teachers a license to obtain software, all software, any software, for nothing? Does anyone demand a licensing fee, each time a child is taught the alphabet?" ~ William Gibson
Convert between Binary, Decimal, Hex and Base 36.
ANSI Colours in the Windows terminal.
Greek alphabet and unicode accents.
GenChr.cmd - Generate an ASCII/Unicode character.
Virtual-Key Codes - Microsoft.com
man ascii - Produce an ASCII table on most Unix systems.