ASCII Table
All 128 ASCII characters with their codes in every base.
About ASCII table
ASCII (the American Standard Code for Information Interchange) assigns numbers 0 to 127 to the English letters, digits, punctuation and a set of control characters, using 7 bits. Codes 0 to 31 and 127 are control characters, originally commands for teleprinters, of which tab (9), line feed (10) and carriage return (13) are still everywhere. Codes 32 to 126 are printable, starting with the space.
UTF-8, the encoding of nearly every web page, is backward compatible with ASCII: the first 128 code points are encoded as the same single bytes, so ASCII text is valid UTF-8. A few patterns are worth knowing: digits 0-9 are 48-57 (0x30-0x39), uppercase letters are 65-90 and lowercase 97-122, exactly 32 apart, so flipping bit 5 (0x20) switches case. Codes 128-255 are not ASCII: their meaning depends on the encoding, such as Latin-1 or Windows-1252.
128 entries
Control characters (0-31)
| Dec | Hex | Oct | Binary | Char | Description |
|---|---|---|---|---|---|
| 0 | 00 | 000 | 0000000 | NUL | Null |
| 1 | 01 | 001 | 0000001 | SOH | Start of heading |
| 2 | 02 | 002 | 0000010 | STX | Start of text |
| 3 | 03 | 003 | 0000011 | ETX | End of text (Ctrl+C) |
| 4 | 04 | 004 | 0000100 | EOT | End of transmission (Ctrl+D) |
| 5 | 05 | 005 | 0000101 | ENQ | Enquiry |
| 6 | 06 | 006 | 0000110 | ACK | Acknowledge |
| 7 | 07 | 007 | 0000111 | BEL | Bell (\a) |
| 8 | 08 | 010 | 0001000 | BS | Backspace (\b) |
| 9 | 09 | 011 | 0001001 | HT | Horizontal tab (\t) |
| 10 | 0A | 012 | 0001010 | LF | Line feed, newline (\n) |
| 11 | 0B | 013 | 0001011 | VT | Vertical tab (\v) |
| 12 | 0C | 014 | 0001100 | FF | Form feed (\f) |
| 13 | 0D | 015 | 0001101 | CR | Carriage return (\r) |
| 14 | 0E | 016 | 0001110 | SO | Shift out |
| 15 | 0F | 017 | 0001111 | SI | Shift in |
| 16 | 10 | 020 | 0010000 | DLE | Data link escape |
| 17 | 11 | 021 | 0010001 | DC1 | Device control 1 (XON) |
| 18 | 12 | 022 | 0010010 | DC2 | Device control 2 |
| 19 | 13 | 023 | 0010011 | DC3 | Device control 3 (XOFF) |
| 20 | 14 | 024 | 0010100 | DC4 | Device control 4 |
| 21 | 15 | 025 | 0010101 | NAK | Negative acknowledge |
| 22 | 16 | 026 | 0010110 | SYN | Synchronous idle |
| 23 | 17 | 027 | 0010111 | ETB | End of transmission block |
| 24 | 18 | 030 | 0011000 | CAN | Cancel |
| 25 | 19 | 031 | 0011001 | EM | End of medium |
| 26 | 1A | 032 | 0011010 | SUB | Substitute (Ctrl+Z) |
| 27 | 1B | 033 | 0011011 | ESC | Escape (\e, \x1b) |
| 28 | 1C | 034 | 0011100 | FS | File separator |
| 29 | 1D | 035 | 0011101 | GS | Group separator |
| 30 | 1E | 036 | 0011110 | RS | Record separator |
| 31 | 1F | 037 | 0011111 | US | Unit separator |
Printable characters (32-126) and DEL (127)
| Dec | Hex | Oct | Binary | Char | Description |
|---|---|---|---|---|---|
| 32 | 20 | 040 | 0100000 | SP | Space |
| 33 | 21 | 041 | 0100001 | ! | Exclamation mark |
| 34 | 22 | 042 | 0100010 | " | Double quote |
| 35 | 23 | 043 | 0100011 | # | Number sign, hash |
| 36 | 24 | 044 | 0100100 | $ | Dollar sign |
| 37 | 25 | 045 | 0100101 | % | Percent sign |
| 38 | 26 | 046 | 0100110 | & | Ampersand |
| 39 | 27 | 047 | 0100111 | ' | Apostrophe, single quote |
| 40 | 28 | 050 | 0101000 | ( | Left parenthesis |
| 41 | 29 | 051 | 0101001 | ) | Right parenthesis |
| 42 | 2A | 052 | 0101010 | * | Asterisk |
| 43 | 2B | 053 | 0101011 | + | Plus sign |
| 44 | 2C | 054 | 0101100 | , | Comma |
| 45 | 2D | 055 | 0101101 | - | Hyphen-minus |
| 46 | 2E | 056 | 0101110 | . | Period, full stop |
| 47 | 2F | 057 | 0101111 | / | Slash |
| 48 | 30 | 060 | 0110000 | 0 | Digit 0 |
| 49 | 31 | 061 | 0110001 | 1 | Digit 1 |
| 50 | 32 | 062 | 0110010 | 2 | Digit 2 |
| 51 | 33 | 063 | 0110011 | 3 | Digit 3 |
| 52 | 34 | 064 | 0110100 | 4 | Digit 4 |
| 53 | 35 | 065 | 0110101 | 5 | Digit 5 |
| 54 | 36 | 066 | 0110110 | 6 | Digit 6 |
| 55 | 37 | 067 | 0110111 | 7 | Digit 7 |
| 56 | 38 | 070 | 0111000 | 8 | Digit 8 |
| 57 | 39 | 071 | 0111001 | 9 | Digit 9 |
| 58 | 3A | 072 | 0111010 | : | Colon |
| 59 | 3B | 073 | 0111011 | ; | Semicolon |
| 60 | 3C | 074 | 0111100 | < | Less-than sign |
| 61 | 3D | 075 | 0111101 | = | Equals sign |
| 62 | 3E | 076 | 0111110 | > | Greater-than sign |
| 63 | 3F | 077 | 0111111 | ? | Question mark |
| 64 | 40 | 100 | 1000000 | @ | At sign |
| 65 | 41 | 101 | 1000001 | A | Uppercase A |
| 66 | 42 | 102 | 1000010 | B | Uppercase B |
| 67 | 43 | 103 | 1000011 | C | Uppercase C |
| 68 | 44 | 104 | 1000100 | D | Uppercase D |
| 69 | 45 | 105 | 1000101 | E | Uppercase E |
| 70 | 46 | 106 | 1000110 | F | Uppercase F |
| 71 | 47 | 107 | 1000111 | G | Uppercase G |
| 72 | 48 | 110 | 1001000 | H | Uppercase H |
| 73 | 49 | 111 | 1001001 | I | Uppercase I |
| 74 | 4A | 112 | 1001010 | J | Uppercase J |
| 75 | 4B | 113 | 1001011 | K | Uppercase K |
| 76 | 4C | 114 | 1001100 | L | Uppercase L |
| 77 | 4D | 115 | 1001101 | M | Uppercase M |
| 78 | 4E | 116 | 1001110 | N | Uppercase N |
| 79 | 4F | 117 | 1001111 | O | Uppercase O |
| 80 | 50 | 120 | 1010000 | P | Uppercase P |
| 81 | 51 | 121 | 1010001 | Q | Uppercase Q |
| 82 | 52 | 122 | 1010010 | R | Uppercase R |
| 83 | 53 | 123 | 1010011 | S | Uppercase S |
| 84 | 54 | 124 | 1010100 | T | Uppercase T |
| 85 | 55 | 125 | 1010101 | U | Uppercase U |
| 86 | 56 | 126 | 1010110 | V | Uppercase V |
| 87 | 57 | 127 | 1010111 | W | Uppercase W |
| 88 | 58 | 130 | 1011000 | X | Uppercase X |
| 89 | 59 | 131 | 1011001 | Y | Uppercase Y |
| 90 | 5A | 132 | 1011010 | Z | Uppercase Z |
| 91 | 5B | 133 | 1011011 | [ | Left square bracket |
| 92 | 5C | 134 | 1011100 | \ | Backslash |
| 93 | 5D | 135 | 1011101 | ] | Right square bracket |
| 94 | 5E | 136 | 1011110 | ^ | Caret, circumflex |
| 95 | 5F | 137 | 1011111 | _ | Underscore |
| 96 | 60 | 140 | 1100000 | ` | Grave accent, backtick |
| 97 | 61 | 141 | 1100001 | a | Lowercase a |
| 98 | 62 | 142 | 1100010 | b | Lowercase b |
| 99 | 63 | 143 | 1100011 | c | Lowercase c |
| 100 | 64 | 144 | 1100100 | d | Lowercase d |
| 101 | 65 | 145 | 1100101 | e | Lowercase e |
| 102 | 66 | 146 | 1100110 | f | Lowercase f |
| 103 | 67 | 147 | 1100111 | g | Lowercase g |
| 104 | 68 | 150 | 1101000 | h | Lowercase h |
| 105 | 69 | 151 | 1101001 | i | Lowercase i |
| 106 | 6A | 152 | 1101010 | j | Lowercase j |
| 107 | 6B | 153 | 1101011 | k | Lowercase k |
| 108 | 6C | 154 | 1101100 | l | Lowercase l |
| 109 | 6D | 155 | 1101101 | m | Lowercase m |
| 110 | 6E | 156 | 1101110 | n | Lowercase n |
| 111 | 6F | 157 | 1101111 | o | Lowercase o |
| 112 | 70 | 160 | 1110000 | p | Lowercase p |
| 113 | 71 | 161 | 1110001 | q | Lowercase q |
| 114 | 72 | 162 | 1110010 | r | Lowercase r |
| 115 | 73 | 163 | 1110011 | s | Lowercase s |
| 116 | 74 | 164 | 1110100 | t | Lowercase t |
| 117 | 75 | 165 | 1110101 | u | Lowercase u |
| 118 | 76 | 166 | 1110110 | v | Lowercase v |
| 119 | 77 | 167 | 1110111 | w | Lowercase w |
| 120 | 78 | 170 | 1111000 | x | Lowercase x |
| 121 | 79 | 171 | 1111001 | y | Lowercase y |
| 122 | 7A | 172 | 1111010 | z | Lowercase z |
| 123 | 7B | 173 | 1111011 | { | Left curly brace |
| 124 | 7C | 174 | 1111100 | | | Vertical bar, pipe |
| 125 | 7D | 175 | 1111101 | } | Right curly brace |
| 126 | 7E | 176 | 1111110 | ~ | Tilde |
| 127 | 7F | 177 | 1111111 | DEL | Delete |
Good to know
Line endings
Unix, Linux and macOS end lines with LF (10, \n). Windows uses CR followed by LF (13 10, \r\n). Classic Mac OS used CR alone. Mixed line endings are a common cause of noisy diffs and failing scripts.
More references
- HTTP status codesEvery HTTP status code and what it means
- MIME typesCommon MIME types by file extension
- HTML entitiesNamed HTML entities with their codes
- Regex cheat sheetRegular expression syntax at a glance
- Cron examples30 common cron schedules explained
- Chmod examplesCommon Unix permissions like 644 and 755
- Unix timestamp referenceNotable epochs, the 2038 problem and code
- Git cheat sheetEveryday Git commands in one place
- Markdown cheat sheetMarkdown and GitHub Flavored syntax