Quick ASCII lookups
ASCII is a 7-bit code, so it has exactly 128 codes, 0 to 127. Symbols such as ♥ and © are not ASCII at all: they come from Unicode and from 8-bit code pages such as Windows-1252 and code page 437.
| Lookup | Decimal | Hex | Binary | Character | Note |
|---|---|---|---|---|---|
| ascii 0 (the digit zero) | 48 | 30 | 00110000 | 0 | The character 0 is code 48 (0x30). Digits 0–9 are codes 48–57. |
| ascii 0 (the NUL character) | 0 | 00 | 00000000 | NUL | Code 0 is NUL, the all-zeros control character, used as a string terminator in C. |
| ascii a | 97 | 61 | 01100001 | a | Lowercase a is 97 (0x61); uppercase A is 65 (0x41). Case differs by exactly 32. |
| ascii A | 65 | 41 | 01000001 | A | Uppercase letters A–Z are 65–90. |
| ascii space | 32 | 20 | 00100000 | (space) | Space is 32 (0x20), the first printable code. |
| ascii enter | 13 | 0D | 00001101 | CR | Enter is traditionally CR, carriage return (13). Unix text ends lines with LF (10); Windows uses CR LF (13, 10). |
| ascii tab | 9 | 09 | 00001001 | HT | Horizontal tab is 9 (0x09). |
| ascii escape | 27 | 1B | 00011011 | ESC | Escape is 27 (0x1B); it begins terminal escape sequences. |
| ascii delete | 127 | 7F | 01111111 | DEL | DEL is 127 (0x7F), all seven bits set. |
| ascii heart | — | — | — | ♥ | Not ASCII. Unicode U+2665 Black Heart Suit; HTML ♥; code page 437 byte 3 (Alt+3 on Windows). |
| ascii copyright | — | — | — | © | Not ASCII. Unicode U+00A9 Copyright Sign; Windows-1252 and Latin-1 byte 169 (Alt+0169); HTML ©. |
Sources: RFC Editor (IETF): RFC 20: ASCII format for network interchange; Unicode Consortium: Unicode Character Database: UnicodeData.txt
ASCII control characters (0–31 and 127)
Codes 0 to 31 and 127 are control characters: they were designed to control devices and data links rather than print. A few are still in daily use: tab (9), line feed (10), carriage return (13) and escape (27).
| Decimal | Hex | Binary | Octal | Abbreviation | Name |
|---|---|---|---|---|---|
| 0 | 00 | 00000000 | 000 | NUL | Null |
| 1 | 01 | 00000001 | 001 | SOH | Start of Heading |
| 2 | 02 | 00000010 | 002 | STX | Start of Text |
| 3 | 03 | 00000011 | 003 | ETX | End of Text |
| 4 | 04 | 00000100 | 004 | EOT | End of Transmission |
| 5 | 05 | 00000101 | 005 | ENQ | Enquiry |
| 6 | 06 | 00000110 | 006 | ACK | Acknowledge |
| 7 | 07 | 00000111 | 007 | BEL | Bell |
| 8 | 08 | 00001000 | 010 | BS | Backspace |
| 9 | 09 | 00001001 | 011 | HT | Horizontal Tabulation (Tab) |
| 10 | 0A | 00001010 | 012 | LF | Line Feed |
| 11 | 0B | 00001011 | 013 | VT | Vertical Tabulation |
| 12 | 0C | 00001100 | 014 | FF | Form Feed |
| 13 | 0D | 00001101 | 015 | CR | Carriage Return |
| 14 | 0E | 00001110 | 016 | SO | Shift Out |
| 15 | 0F | 00001111 | 017 | SI | Shift In |
| 16 | 10 | 00010000 | 020 | DLE | Data Link Escape |
| 17 | 11 | 00010001 | 021 | DC1 | Device Control 1 |
| 18 | 12 | 00010010 | 022 | DC2 | Device Control 2 |
| 19 | 13 | 00010011 | 023 | DC3 | Device Control 3 |
| 20 | 14 | 00010100 | 024 | DC4 | Device Control 4 |
| 21 | 15 | 00010101 | 025 | NAK | Negative Acknowledge |
| 22 | 16 | 00010110 | 026 | SYN | Synchronous Idle |
| 23 | 17 | 00010111 | 027 | ETB | End of Transmission Block |
| 24 | 18 | 00011000 | 030 | CAN | Cancel |
| 25 | 19 | 00011001 | 031 | EM | End of Medium |
| 26 | 1A | 00011010 | 032 | SUB | Substitute |
| 27 | 1B | 00011011 | 033 | ESC | Escape |
| 28 | 1C | 00011100 | 034 | FS | File Separator |
| 29 | 1D | 00011101 | 035 | GS | Group Separator |
| 30 | 1E | 00011110 | 036 | RS | Record Separator |
| 31 | 1F | 00011111 | 037 | US | Unit Separator |
| 127 | 7F | 01111111 | 177 | DEL | Delete |
Sources: RFC Editor (IETF): RFC 20: ASCII format for network interchange
ASCII printable characters (32–126)
Codes 32 to 126 are the 95 printable characters: space, punctuation, digits 0–9 (48–57), uppercase A–Z (65–90) and lowercase a–z (97–122). Setting bit 5 (adding 32) turns an uppercase letter into its lowercase form. Binary values are shown as 8-bit bytes with a leading 0.
| Decimal | Hex | Binary | Octal | Character | Name |
|---|---|---|---|---|---|
| 32 | 20 | 00100000 | 040 | (space) | Space |
| 33 | 21 | 00100001 | 041 | ! | Exclamation Mark |
| 34 | 22 | 00100010 | 042 | " | Quotation Mark |
| 35 | 23 | 00100011 | 043 | # | Number Sign |
| 36 | 24 | 00100100 | 044 | $ | Dollar Sign |
| 37 | 25 | 00100101 | 045 | % | Percent Sign |
| 38 | 26 | 00100110 | 046 | & | Ampersand |
| 39 | 27 | 00100111 | 047 | ' | Apostrophe |
| 40 | 28 | 00101000 | 050 | ( | Left Parenthesis |
| 41 | 29 | 00101001 | 051 | ) | Right Parenthesis |
| 42 | 2A | 00101010 | 052 | * | Asterisk |
| 43 | 2B | 00101011 | 053 | + | Plus Sign |
| 44 | 2C | 00101100 | 054 | , | Comma |
| 45 | 2D | 00101101 | 055 | - | Hyphen-Minus |
| 46 | 2E | 00101110 | 056 | . | Full Stop |
| 47 | 2F | 00101111 | 057 | / | Solidus |
| 48 | 30 | 00110000 | 060 | 0 | Digit Zero |
| 49 | 31 | 00110001 | 061 | 1 | Digit One |
| 50 | 32 | 00110010 | 062 | 2 | Digit Two |
| 51 | 33 | 00110011 | 063 | 3 | Digit Three |
| 52 | 34 | 00110100 | 064 | 4 | Digit Four |
| 53 | 35 | 00110101 | 065 | 5 | Digit Five |
| 54 | 36 | 00110110 | 066 | 6 | Digit Six |
| 55 | 37 | 00110111 | 067 | 7 | Digit Seven |
| 56 | 38 | 00111000 | 070 | 8 | Digit Eight |
| 57 | 39 | 00111001 | 071 | 9 | Digit Nine |
| 58 | 3A | 00111010 | 072 | : | Colon |
| 59 | 3B | 00111011 | 073 | ; | Semicolon |
| 60 | 3C | 00111100 | 074 | < | Less-Than Sign |
| 61 | 3D | 00111101 | 075 | = | Equals Sign |
| 62 | 3E | 00111110 | 076 | > | Greater-Than Sign |
| 63 | 3F | 00111111 | 077 | ? | Question Mark |
| 64 | 40 | 01000000 | 100 | @ | Commercial At |
| 65 | 41 | 01000001 | 101 | A | Latin Capital Letter A |
| 66 | 42 | 01000010 | 102 | B | Latin Capital Letter B |
| 67 | 43 | 01000011 | 103 | C | Latin Capital Letter C |
| 68 | 44 | 01000100 | 104 | D | Latin Capital Letter D |
| 69 | 45 | 01000101 | 105 | E | Latin Capital Letter E |
| 70 | 46 | 01000110 | 106 | F | Latin Capital Letter F |
| 71 | 47 | 01000111 | 107 | G | Latin Capital Letter G |
| 72 | 48 | 01001000 | 110 | H | Latin Capital Letter H |
| 73 | 49 | 01001001 | 111 | I | Latin Capital Letter I |
| 74 | 4A | 01001010 | 112 | J | Latin Capital Letter J |
| 75 | 4B | 01001011 | 113 | K | Latin Capital Letter K |
| 76 | 4C | 01001100 | 114 | L | Latin Capital Letter L |
| 77 | 4D | 01001101 | 115 | M | Latin Capital Letter M |
| 78 | 4E | 01001110 | 116 | N | Latin Capital Letter N |
| 79 | 4F | 01001111 | 117 | O | Latin Capital Letter O |
| 80 | 50 | 01010000 | 120 | P | Latin Capital Letter P |
| 81 | 51 | 01010001 | 121 | Q | Latin Capital Letter Q |
| 82 | 52 | 01010010 | 122 | R | Latin Capital Letter R |
| 83 | 53 | 01010011 | 123 | S | Latin Capital Letter S |
| 84 | 54 | 01010100 | 124 | T | Latin Capital Letter T |
| 85 | 55 | 01010101 | 125 | U | Latin Capital Letter U |
| 86 | 56 | 01010110 | 126 | V | Latin Capital Letter V |
| 87 | 57 | 01010111 | 127 | W | Latin Capital Letter W |
| 88 | 58 | 01011000 | 130 | X | Latin Capital Letter X |
| 89 | 59 | 01011001 | 131 | Y | Latin Capital Letter Y |
| 90 | 5A | 01011010 | 132 | Z | Latin Capital Letter Z |
| 91 | 5B | 01011011 | 133 | [ | Left Square Bracket |
| 92 | 5C | 01011100 | 134 | \ | Reverse Solidus |
| 93 | 5D | 01011101 | 135 | ] | Right Square Bracket |
| 94 | 5E | 01011110 | 136 | ^ | Circumflex Accent |
| 95 | 5F | 01011111 | 137 | _ | Low Line |
| 96 | 60 | 01100000 | 140 | ` | Grave Accent |
| 97 | 61 | 01100001 | 141 | a | Latin Small Letter A |
| 98 | 62 | 01100010 | 142 | b | Latin Small Letter B |
| 99 | 63 | 01100011 | 143 | c | Latin Small Letter C |
| 100 | 64 | 01100100 | 144 | d | Latin Small Letter D |
| 101 | 65 | 01100101 | 145 | e | Latin Small Letter E |
| 102 | 66 | 01100110 | 146 | f | Latin Small Letter F |
| 103 | 67 | 01100111 | 147 | g | Latin Small Letter G |
| 104 | 68 | 01101000 | 150 | h | Latin Small Letter H |
| 105 | 69 | 01101001 | 151 | i | Latin Small Letter I |
| 106 | 6A | 01101010 | 152 | j | Latin Small Letter J |
| 107 | 6B | 01101011 | 153 | k | Latin Small Letter K |
| 108 | 6C | 01101100 | 154 | l | Latin Small Letter L |
| 109 | 6D | 01101101 | 155 | m | Latin Small Letter M |
| 110 | 6E | 01101110 | 156 | n | Latin Small Letter N |
| 111 | 6F | 01101111 | 157 | o | Latin Small Letter O |
| 112 | 70 | 01110000 | 160 | p | Latin Small Letter P |
| 113 | 71 | 01110001 | 161 | q | Latin Small Letter Q |
| 114 | 72 | 01110010 | 162 | r | Latin Small Letter R |
| 115 | 73 | 01110011 | 163 | s | Latin Small Letter S |
| 116 | 74 | 01110100 | 164 | t | Latin Small Letter T |
| 117 | 75 | 01110101 | 165 | u | Latin Small Letter U |
| 118 | 76 | 01110110 | 166 | v | Latin Small Letter V |
| 119 | 77 | 01110111 | 167 | w | Latin Small Letter W |
| 120 | 78 | 01111000 | 170 | x | Latin Small Letter X |
| 121 | 79 | 01111001 | 171 | y | Latin Small Letter Y |
| 122 | 7A | 01111010 | 172 | z | Latin Small Letter Z |
| 123 | 7B | 01111011 | 173 | { | Left Curly Bracket |
| 124 | 7C | 01111100 | 174 | | | Vertical Line |
| 125 | 7D | 01111101 | 175 | } | Right Curly Bracket |
| 126 | 7E | 01111110 | 176 | ~ | Tilde |
Sources: RFC Editor (IETF): RFC 20: ASCII format for network interchange; Unicode Consortium: Unicode Character Database: UnicodeData.txt