ASCII table
ASCII maps the codes 0 to 127 to characters.
The codes 0 to 31 are control codes. The codes 32 to 126 are printable. The code 127 is delete.
Each code fits in 7 bits, so a byte holds one ASCII character with the top bit clear.
Try the ASCII table in the bit editor
The code 65, which is the character A. Edit the expression or select a bit to flip it.
7
6
5
4
3
2
1
0
A
text · 8 bits
- value
- 65
- hex
- 0x41
Every printable ASCII code
| Character | Decimal | Hex | Binary |
|---|---|---|---|
| space | 32 | 0x20 | 00100000 |
| ! | 33 | 0x21 | 00100001 |
| " | 34 | 0x22 | 00100010 |
| # | 35 | 0x23 | 00100011 |
| $ | 36 | 0x24 | 00100100 |
| % | 37 | 0x25 | 00100101 |
| & | 38 | 0x26 | 00100110 |
| ' | 39 | 0x27 | 00100111 |
| ( | 40 | 0x28 | 00101000 |
| ) | 41 | 0x29 | 00101001 |
| * | 42 | 0x2A | 00101010 |
| + | 43 | 0x2B | 00101011 |
| , | 44 | 0x2C | 00101100 |
| - | 45 | 0x2D | 00101101 |
| . | 46 | 0x2E | 00101110 |
| / | 47 | 0x2F | 00101111 |
| 0 | 48 | 0x30 | 00110000 |
| 1 | 49 | 0x31 | 00110001 |
| 2 | 50 | 0x32 | 00110010 |
| 3 | 51 | 0x33 | 00110011 |
| 4 | 52 | 0x34 | 00110100 |
| 5 | 53 | 0x35 | 00110101 |
| 6 | 54 | 0x36 | 00110110 |
| 7 | 55 | 0x37 | 00110111 |
| 8 | 56 | 0x38 | 00111000 |
| 9 | 57 | 0x39 | 00111001 |
| : | 58 | 0x3A | 00111010 |
| ; | 59 | 0x3B | 00111011 |
| < | 60 | 0x3C | 00111100 |
| = | 61 | 0x3D | 00111101 |
| > | 62 | 0x3E | 00111110 |
| ? | 63 | 0x3F | 00111111 |
| @ | 64 | 0x40 | 01000000 |
| A | 65 | 0x41 | 01000001 |
| B | 66 | 0x42 | 01000010 |
| C | 67 | 0x43 | 01000011 |
| D | 68 | 0x44 | 01000100 |
| E | 69 | 0x45 | 01000101 |
| F | 70 | 0x46 | 01000110 |
| G | 71 | 0x47 | 01000111 |
| H | 72 | 0x48 | 01001000 |
| I | 73 | 0x49 | 01001001 |
| J | 74 | 0x4A | 01001010 |
| K | 75 | 0x4B | 01001011 |
| L | 76 | 0x4C | 01001100 |
| M | 77 | 0x4D | 01001101 |
| N | 78 | 0x4E | 01001110 |
| O | 79 | 0x4F | 01001111 |
| P | 80 | 0x50 | 01010000 |
| Q | 81 | 0x51 | 01010001 |
| R | 82 | 0x52 | 01010010 |
| S | 83 | 0x53 | 01010011 |
| T | 84 | 0x54 | 01010100 |
| U | 85 | 0x55 | 01010101 |
| V | 86 | 0x56 | 01010110 |
| W | 87 | 0x57 | 01010111 |
| X | 88 | 0x58 | 01011000 |
| Y | 89 | 0x59 | 01011001 |
| Z | 90 | 0x5A | 01011010 |
| [ | 91 | 0x5B | 01011011 |
| \ | 92 | 0x5C | 01011100 |
| ] | 93 | 0x5D | 01011101 |
| ^ | 94 | 0x5E | 01011110 |
| _ | 95 | 0x5F | 01011111 |
| ` | 96 | 0x60 | 01100000 |
| a | 97 | 0x61 | 01100001 |
| b | 98 | 0x62 | 01100010 |
| c | 99 | 0x63 | 01100011 |
| d | 100 | 0x64 | 01100100 |
| e | 101 | 0x65 | 01100101 |
| f | 102 | 0x66 | 01100110 |
| g | 103 | 0x67 | 01100111 |
| h | 104 | 0x68 | 01101000 |
| i | 105 | 0x69 | 01101001 |
| j | 106 | 0x6A | 01101010 |
| k | 107 | 0x6B | 01101011 |
| l | 108 | 0x6C | 01101100 |
| m | 109 | 0x6D | 01101101 |
| n | 110 | 0x6E | 01101110 |
| o | 111 | 0x6F | 01101111 |
| p | 112 | 0x70 | 01110000 |
| q | 113 | 0x71 | 01110001 |
| r | 114 | 0x72 | 01110010 |
| s | 115 | 0x73 | 01110011 |
| t | 116 | 0x74 | 01110100 |
| u | 117 | 0x75 | 01110101 |
| v | 118 | 0x76 | 01110110 |
| w | 119 | 0x77 | 01110111 |
| x | 120 | 0x78 | 01111000 |
| y | 121 | 0x79 | 01111001 |
| z | 122 | 0x7A | 01111010 |
| { | 123 | 0x7B | 01111011 |
| | | 124 | 0x7C | 01111100 |
| } | 125 | 0x7D | 01111101 |
| ~ | 126 | 0x7E | 01111110 |
Where the ASCII table is used
A terminal, a serial monitor and a text file all agree on these codes.
A protocol that sends a command as text depends on the exact code of each letter.
Every later code set keeps these 128 codes. UTF-8 keeps them too.
The ASCII table: points to note
- The blocks are not adjacent. The digits start at 48, the capitals at 65, and the small letters at 97.
- The gap between a capital letter and its small form is 32, which is one bit: bit 5.
- The code 0 is not the digit 0. The code 0 is a null character.
- A code above 127 is outside ASCII. Do not assume a single byte holds one character.
The full bit editor
The full editor holds many values, evaluates expressions across them, and reads live values from a serial port.
Open this value in the full editorQuestions about the ASCII table
- How many characters does ASCII hold?
- ASCII holds 128 codes, from 0 to 127. Of those, 95 are printable.
- What is the ASCII code of a space?
- A space has the code 32, which is 0x20 and 00100000.
- How do I convert a capital letter to a small letter with a bitwise operation?
- Apply OR with 0x20 to get the small letter, and AND with 0xDF to get the capital letter.