ASCII (ASCII) gives each of 128 characters a number from 0 to 127. Codes 32 to 126 are the printable characters below; 0 to 31 and 127 are control codes that were designed for teleprinters. Convert text with the Text to ASCII Converter and ASCII to Text Converter, or change base with the Number Base Converter.
Printable characters (32 to 126)
| Dec | Hex | Char | Dec | Hex | Char | Dec | Hex | Char | Dec | Hex | Char |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 32 | 20 | space |
56 | 38 | 8 |
80 | 50 | P |
104 | 68 | h |
| 33 | 21 | ! |
57 | 39 | 9 |
81 | 51 | Q |
105 | 69 | i |
| 34 | 22 | " |
58 | 3A | : |
82 | 52 | R |
106 | 6A | j |
| 35 | 23 | # |
59 | 3B | ; |
83 | 53 | S |
107 | 6B | k |
| 36 | 24 | $ |
60 | 3C | < |
84 | 54 | T |
108 | 6C | l |
| 37 | 25 | % |
61 | 3D | = |
85 | 55 | U |
109 | 6D | m |
| 38 | 26 | & |
62 | 3E | > |
86 | 56 | V |
110 | 6E | n |
| 39 | 27 | ' |
63 | 3F | ? |
87 | 57 | W |
111 | 6F | o |
| 40 | 28 | ( |
64 | 40 | @ |
88 | 58 | X |
112 | 70 | p |
| 41 | 29 | ) |
65 | 41 | A |
89 | 59 | Y |
113 | 71 | q |
| 42 | 2A | * |
66 | 42 | B |
90 | 5A | Z |
114 | 72 | r |
| 43 | 2B | + |
67 | 43 | C |
91 | 5B | [ |
115 | 73 | s |
| 44 | 2C | , |
68 | 44 | D |
92 | 5C | \ |
116 | 74 | t |
| 45 | 2D | - |
69 | 45 | E |
93 | 5D | ] |
117 | 75 | u |
| 46 | 2E | . |
70 | 46 | F |
94 | 5E | ^ |
118 | 76 | v |
| 47 | 2F | / |
71 | 47 | G |
95 | 5F | _ |
119 | 77 | w |
| 48 | 30 | 0 |
72 | 48 | H |
96 | 60 | ` |
120 | 78 | x |
| 49 | 31 | 1 |
73 | 49 | I |
97 | 61 | a |
121 | 79 | y |
| 50 | 32 | 2 |
74 | 4A | J |
98 | 62 | b |
122 | 7A | z |
| 51 | 33 | 3 |
75 | 4B | K |
99 | 63 | c |
123 | 7B | { |
| 52 | 34 | 4 |
76 | 4C | L |
100 | 64 | d |
124 | 7C | | |
| 53 | 35 | 5 |
77 | 4D | M |
101 | 65 | e |
125 | 7D | } |
| 54 | 36 | 6 |
78 | 4E | N |
102 | 66 | f |
126 | 7E | ~ |
| 55 | 37 | 7 |
79 | 4F | O |
103 | 67 | g |
Control characters you will meet
| Dec | Hex | Name | Meaning | Escape |
|---|---|---|---|---|
| 0 | 00 | NUL |
Null | \0 |
| 7 | 07 | BEL |
Bell (beep) | \a |
| 8 | 08 | BS |
Backspace | \b |
| 9 | 09 | HT |
Horizontal tab | \t |
| 10 | 0A | LF |
Line feed (newline) | \n |
| 11 | 0B | VT |
Vertical tab | \v |
| 12 | 0C | FF |
Form feed | \f |
| 13 | 0D | CR |
Carriage return | \r |
| 27 | 1B | ESC |
Escape | \e |
| 127 | 7F | DEL |
Delete |
The other control codes (SOH, STX, ETX, EOT, ENQ, ACK, SO, SI, DLE, DC1 to DC4, NAK, SYN, ETB, CAN, EM, SUB, FS, GS, RS and US) fill codes 1 to 31 and are rare outside serial protocols. EOT (4) is what Ctrl+D sends in a terminal.
Patterns worth knowing
- Digits
0to9are 48 to 57, so a digit's value is its code minus 48. - Upper-case letters
AtoZare 65 to 90 and lower-caseatozare 97 to 122. They differ by exactly 32, one bit, so flipping bit 5 switches case. - Control characters can be typed as Ctrl plus a letter:
Ctrl+JisLF(10) andCtrl+MisCR(13). - Line endings. Unix and macOS end lines with
LF(10), Windows withCRLF(13 10), and very old Mac systems withCR. - Beyond 127. ASCII is only 7 bits. "Extended ASCII" tables differ by system; use UTF-8 for anything outside the table.