ASCII Table — 0–127, Extended 128–255 and Alt Codes

Every ASCII code 0–127 in decimal, binary, hex and octal, plus the extended 128–255 table, Alt codes and the fix for ñ garbage.

No signup, no tracking

ASCII Table — 0–127, Extended 128–255 and Alt Codes

Scan with a phone camera to open this page

sofritools.com/reference/ascii-table/

WhatsApp

Quick answers: ASCII covers 0–127 only. A is 65 (hex 41), a is 97 (hex 61), the digit 0 is 48, space is 32, line feed is 10 and carriage return is 13. Anything above 127 — é, ñ, €, curly quotes — is “extended ASCII”, which in practice means the Windows-1252 code page: é is 233 (Alt+0233), ñ is 241 (Alt+0241), € is 128. In UTF-8 those same characters take two or three bytes, which is why they turn into é or € when a file is opened in the wrong encoding. All of it is in the tables below.

ASCII is 128 characters — 33 control codes and 95 printable characters — each identified by a number from 0 to 127. This is the lookup table: every code in decimal, binary, hexadecimal and octal, with the name and purpose of each control character explained. Ctrl+F to find any character by name or code.

ASCII (American Standard Code for Information Interchange) was standardized in 1963 and remains the base of every modern text encoding, including UTF-8. The first 128 code points of Unicode are identical to ASCII by design, which is why a plain-ASCII file and its UTF-8 version look bit-for-bit the same.

Printable ASCII characters (32–126)

The characters you actually type: space, digits, uppercase and lowercase letters, and punctuation. Every keyboard on Earth speaks these.

DecHexBinOctCharNotes
32200100000040(space)Space
33210100001041!Exclamation
34220100010042"Double quote
35230100011043#Hash / number sign
36240100100044$Dollar sign
37250100101045%Percent
38260100110046&Ampersand
39270100111047'Single quote / apostrophe
40280101000050(Left parenthesis
41290101001051)Right parenthesis
422A0101010052*Asterisk
432B0101011053+Plus
442C0101100054,Comma
452D0101101055-Hyphen / minus
462E0101110056.Period / dot
472F0101111057/Slash
483001100000600Digit zero
493101100010611Digit one
503201100100622Digit two
513301100110633Digit three
523401101000644Digit four
533501101010655Digit five
543601101100666Digit six
553701101110677Digit seven
563801110000708Digit eight
573901110010719Digit nine
583A0111010072:Colon
593B0111011073;Semicolon
603C0111100074<Less than
613D0111101075=Equals
623E0111110076>Greater than
633F0111111077?Question mark
64401000000100@At sign
65411000001101AUppercase A
66421000010102BUppercase B
67431000011103CUppercase C
68441000100104DUppercase D
69451000101105EUppercase E
70461000110106FUppercase F
71471000111107GUppercase G
72481001000110HUppercase H
73491001001111IUppercase I
744A1001010112JUppercase J
754B1001011113KUppercase K
764C1001100114LUppercase L
774D1001101115MUppercase M
784E1001110116NUppercase N
794F1001111117OUppercase O
80501010000120PUppercase P
81511010001121QUppercase Q
82521010010122RUppercase R
83531010011123SUppercase S
84541010100124TUppercase T
85551010101125UUppercase U
86561010110126VUppercase V
87571010111127WUppercase W
88581011000130XUppercase X
89591011001131YUppercase Y
905A1011010132ZUppercase Z
915B1011011133[Left bracket
925C1011100134\Backslash
935D1011101135]Right bracket
945E1011110136^Caret
955F1011111137_Underscore
96601100000140`Backtick / grave accent
97611100001141aLowercase a
98621100010142bLowercase b
99631100011143cLowercase c
100641100100144dLowercase d
101651100101145eLowercase e
102661100110146fLowercase f
103671100111147gLowercase g
104681101000150hLowercase h
105691101001151iLowercase i
1066A1101010152jLowercase j
1076B1101011153kLowercase k
1086C1101100154lLowercase l
1096D1101101155mLowercase m
1106E1101110156nLowercase n
1116F1101111157oLowercase o
112701110000160pLowercase p
113711110001161qLowercase q
114721110010162rLowercase r
115731110011163sLowercase s
116741110100164tLowercase t
117751110101165uLowercase u
118761110110166vLowercase v
119771110111167wLowercase w
120781111000170xLowercase x
121791111001171yLowercase y
1227A1111010172zLowercase z
1237B1111011173{Left brace
1247C1111100174|Pipe / vertical bar
1257D1111101175}Right brace
1267E1111110176~Tilde

ASCII control characters (0–31 and 127)

These are the non-printable codes. Most were designed for teletypes and are now obsolete, but a handful drive modern text (line feed, carriage return, tab, null) and terminal control (escape).

DecHexBinCtrlNamePurpose
0000000000^@NULNull byte — string terminator in C
1010000001^ASOHStart of heading
2020000010^BSTXStart of text
3030000011^CETXEnd of text — Ctrl+C interrupt in shells
4040000100^DEOTEnd of transmission — Ctrl+D end of file
5050000101^EENQEnquiry
6060000110^FACKAcknowledge
7070000111^GBELBell — plays a terminal beep
8080001000^HBSBackspace
9090001001^IHTHorizontal tab
100A0001010^JLFLine feed — Unix newline (\n)
110B0001011^KVTVertical tab
120C0001100^LFFForm feed — page break
130D0001101^MCRCarriage return — half of Windows newline (\r\n)
140E0001110^NSOShift out
150F0001111^OSIShift in
16100010000^PDLEData link escape
17110010001^QDC1Device control 1 — XON
18120010010^RDC2Device control 2
19130010011^SDC3Device control 3 — XOFF
20140010100^TDC4Device control 4
21150010101^UNAKNegative acknowledge
22160010110^VSYNSynchronous idle
23170010111^WETBEnd of transmission block
24180011000^XCANCancel
25190011001^YEMEnd of medium
261A0011010^ZSUBSubstitute — Ctrl+Z suspend / DOS end-of-file
271B0011011^[ESCEscape — leads every ANSI terminal sequence
281C0011100^\FSFile separator
291D0011101^]GSGroup separator
301E0011110^^RSRecord separator
311F0011111^_USUnit separator
1277F1111111^?DELDelete — the highest ASCII value

Convert between characters and codes in code

Excel and Google Sheets — CODE returns the number for a character, CHAR returns the character for a number:
=CODE("A")     → 65
=CHAR(65)      → A
=CHAR(9)       → tab character
=CHAR(10)      → line feed (use in a wrapped cell for a manual line break)

Python — ord and chr do the same:
ord("A")       # 65
chr(65)        # "A"
chr(10)        # "\n"

JavaScript — charCodeAt and String.fromCharCode:
"A".charCodeAt(0)          // 65
String.fromCharCode(65)    // "A"
The two operations you need for every ASCII lookup, in the three most common environments.

What comes after 127 — extended ASCII and UTF-8

ASCII ends at 127. The bytes from 128 to 255 are NOT standard ASCII — they belong to whichever 8-bit codepage the file was saved in (Latin-1 / ISO-8859-1 in Western Europe, Windows-1252, various regional codepages). "Extended ASCII" is really a marketing term for that legacy byte range, and different codepages assign different characters to the same byte, which is the classic cause of "mojibake" (garbled characters) when a file is opened in the wrong encoding.

UTF-8 solved this by encoding every Unicode character (over 150,000 of them and counting) as one to four bytes, with the property that any pure-ASCII text is bit-for-bit identical in UTF-8. That is why saving a plain English text file as ASCII or as UTF-8 produces the same file. The binary-hex reference on this site covers the byte-level view, and the HTML entities tool converts between characters and their HTML entity names for the ones you cannot type directly.

Extended ASCII table (128–255) — Windows-1252

This is the table most people mean by “extended ASCII”: the Windows-1252 code page, the default on Western-language Windows and the encoding Excel still uses when you save a plain “CSV (Comma delimited)” file. Codes 160–255 are identical in ISO-8859-1 (Latin-1) and match Unicode U+00A0–U+00FF one-to-one. Codes 128–159 are where the two disagree: Windows-1252 puts €, the curly quotes, the dashes and ™ there, while Latin-1 leaves them as invisible control codes. Five codes (129, 141, 143, 144 and 157) are unassigned. The last column is the Windows keystroke that types each character — see the next section.

DecHexBinCharUnicodeAlt code
1288010000000€U+20ACAlt+0128
1298110000001(unassigned)——
1308210000010‚U+201AAlt+0130
1318310000011ƒU+0192Alt+0131
1328410000100„U+201EAlt+0132
1338510000101…U+2026Alt+0133
1348610000110†U+2020Alt+0134
1358710000111‡U+2021Alt+0135
1368810001000ˆU+02C6Alt+0136
1378910001001‰U+2030Alt+0137
1388A10001010ŠU+0160Alt+0138
1398B10001011‹U+2039Alt+0139
1408C10001100ŒU+0152Alt+0140
1418D10001101(unassigned)——
1428E10001110ŽU+017DAlt+0142
1438F10001111(unassigned)——
1449010010000(unassigned)——
1459110010001‘U+2018Alt+0145
1469210010010’U+2019Alt+0146
1479310010011“U+201CAlt+0147
1489410010100”U+201DAlt+0148
1499510010101•U+2022Alt+0149
1509610010110–U+2013Alt+0150
1519710010111—U+2014Alt+0151
1529810011000˜U+02DCAlt+0152
1539910011001™U+2122Alt+0153
1549A10011010šU+0161Alt+0154
1559B10011011›U+203AAlt+0155
1569C10011100œU+0153Alt+0156
1579D10011101(unassigned)——
1589E10011110žU+017EAlt+0158
1599F10011111ŸU+0178Alt+0159
160A010100000(no-break space)U+00A0Alt+0160
161A110100001¡U+00A1Alt+0161
162A210100010¢U+00A2Alt+0162
163A310100011£U+00A3Alt+0163
164A410100100¤U+00A4Alt+0164
165A510100101¥U+00A5Alt+0165
166A610100110¦U+00A6Alt+0166
167A710100111§U+00A7Alt+0167
168A810101000¨U+00A8Alt+0168
169A910101001©U+00A9Alt+0169
170AA10101010ªU+00AAAlt+0170
171AB10101011«U+00ABAlt+0171
172AC10101100¬U+00ACAlt+0172
173AD10101101(soft hyphen)U+00ADAlt+0173
174AE10101110®U+00AEAlt+0174
175AF10101111¯U+00AFAlt+0175
176B010110000°U+00B0Alt+0176
177B110110001±U+00B1Alt+0177
178B210110010²U+00B2Alt+0178
179B310110011³U+00B3Alt+0179
180B410110100´U+00B4Alt+0180
181B510110101µU+00B5Alt+0181
182B610110110U+00B6Alt+0182
183B710110111·U+00B7Alt+0183
184B810111000¸U+00B8Alt+0184
185B910111001¹U+00B9Alt+0185
186BA10111010ºU+00BAAlt+0186
187BB10111011»U+00BBAlt+0187
188BC10111100¼U+00BCAlt+0188
189BD10111101½U+00BDAlt+0189
190BE10111110¾U+00BEAlt+0190
191BF10111111¿U+00BFAlt+0191
192C011000000ÀU+00C0Alt+0192
193C111000001ÁU+00C1Alt+0193
194C211000010ÂU+00C2Alt+0194
195C311000011ÃU+00C3Alt+0195
196C411000100ÄU+00C4Alt+0196
197C511000101ÅU+00C5Alt+0197
198C611000110ÆU+00C6Alt+0198
199C711000111ÇU+00C7Alt+0199
200C811001000ÈU+00C8Alt+0200
201C911001001ÉU+00C9Alt+0201
202CA11001010ÊU+00CAAlt+0202
203CB11001011ËU+00CBAlt+0203
204CC11001100ÌU+00CCAlt+0204
205CD11001101ÍU+00CDAlt+0205
206CE11001110ÎU+00CEAlt+0206
207CF11001111ÏU+00CFAlt+0207
208D011010000ÐU+00D0Alt+0208
209D111010001ÑU+00D1Alt+0209
210D211010010ÒU+00D2Alt+0210
211D311010011ÓU+00D3Alt+0211
212D411010100ÔU+00D4Alt+0212
213D511010101ÕU+00D5Alt+0213
214D611010110ÖU+00D6Alt+0214
215D711010111×U+00D7Alt+0215
216D811011000ØU+00D8Alt+0216
217D911011001ÙU+00D9Alt+0217
218DA11011010ÚU+00DAAlt+0218
219DB11011011ÛU+00DBAlt+0219
220DC11011100ÜU+00DCAlt+0220
221DD11011101ÝU+00DDAlt+0221
222DE11011110ÞU+00DEAlt+0222
223DF11011111ßU+00DFAlt+0223
224E011100000àU+00E0Alt+0224
225E111100001áU+00E1Alt+0225
226E211100010âU+00E2Alt+0226
227E311100011ãU+00E3Alt+0227
228E411100100äU+00E4Alt+0228
229E511100101åU+00E5Alt+0229
230E611100110æU+00E6Alt+0230
231E711100111çU+00E7Alt+0231
232E811101000èU+00E8Alt+0232
233E911101001éU+00E9Alt+0233
234EA11101010êU+00EAAlt+0234
235EB11101011ëU+00EBAlt+0235
236EC11101100ìU+00ECAlt+0236
237ED11101101íU+00EDAlt+0237
238EE11101110îU+00EEAlt+0238
239EF11101111ïU+00EFAlt+0239
240F011110000ðU+00F0Alt+0240
241F111110001ñU+00F1Alt+0241
242F211110010òU+00F2Alt+0242
243F311110011óU+00F3Alt+0243
244F411110100ôU+00F4Alt+0244
245F511110101õU+00F5Alt+0245
246F611110110öU+00F6Alt+0246
247F711110111÷U+00F7Alt+0247
248F811111000øU+00F8Alt+0248
249F911111001ùU+00F9Alt+0249
250FA11111010úU+00FAAlt+0250
251FB11111011ûU+00FBAlt+0251
252FC11111100üU+00FCAlt+0252
253FD11111101ýU+00FDAlt+0253
254FE11111110þU+00FEAlt+0254
255FF11111111ÿU+00FFAlt+0255

Alt codes for symbols and accented letters (Windows and Mac)

Windows has two Alt-code systems, which is why the same character shows up online with two different numbers. Alt plus a number WITHOUT a leading zero uses the old DOS code page (437 on US Windows, 850 on most European and Latin American Windows); Alt plus 0 plus a number uses Windows-1252 — the table above. The Alt+0 codes are the same on every Western-language Windows, so they are the safer ones to memorize.

  1. Turn on Num Lock.
  2. Hold down the left Alt key.
  3. Type the number on the numeric keypad — the digit row above the letters does not work.
  4. Release Alt and the character appears.
  5. No numeric keypad (most laptops)? Press Win + . (period) for the emoji and symbol panel, or open Character Map (charmap). On a Mac, use the Option shortcuts in the table.
CharAlt (DOS 437)Alt+0 (Windows-1252)Mac (US keyboard)
°Alt+248Alt+0176Option+Shift+8
©—Alt+0169Option+G
®—Alt+0174Option+R
™—Alt+0153Option+2
€—Alt+0128Option+Shift+2
£Alt+156Alt+0163Option+3
¢Alt+155Alt+0162Option+4
¥Alt+157Alt+0165Option+Y
±Alt+241Alt+0177Option+Shift+=
×—Alt+0215—
÷Alt+246Alt+0247Option+/
½Alt+171Alt+0189—
²Alt+253Alt+0178—
•Alt+7Alt+0149Option+8
— (em dash)—Alt+0151Option+Shift+-
– (en dash)—Alt+0150Option+-
éAlt+130Alt+0233Option+E, then E
ñAlt+164Alt+0241Option+N, then N
¿Alt+168Alt+0191Option+Shift+?

The Spanish letters follow a pattern worth knowing: in the DOS codes the lowercase accented vowels sit together at Alt+160 (á), 161 (í), 162 (ó) and 163 (ú), with é off on its own at 130; ñ is 164 and Ñ is 165. If the character has to go into HTML rather than a document, the HTML entities reference lists the named entities (&ntilde;, &eacute;) instead.

What about a check mark (✓)? It is not ASCII and not in Windows-1252, so there is no true Alt code for it. What works: on Windows, Win + . (period) opens the symbol panel, which has ✓; in Excel, =UNICHAR(10003) gives ✓ and =UNICHAR(10004) the heavy ✔; in Word, type ü (Alt+0252) and switch the font to Wingdings. The Alt+251 trick you will see online gives √ (a square-root sign often used as a check) on English Windows, but ¹ on Spanish-language Windows. On a Mac, Option+V types √.

Why you see ñ instead of ñ (mojibake)

When UTF-8 text is opened as Windows-1252, every non-ASCII character turns into two or three wrong ones. UTF-8 stores ñ as two bytes, C3 B1; Windows-1252 reads each byte on its own — C3 is Ã, B1 is ± — so “España” becomes “España”. It is the classic result of opening a CSV exported from a website, an app or a database by double-clicking it in Excel. The damage is so regular you can read it backwards:

CharacterUTF-8 bytesShows up as (read as Windows-1252)
ñC3 B1ñ
ÑC3 91Ñ
áC3 A1á
éC3 A9é
ÉC3 89É
íC3 ADÃ followed by an invisible soft hyphen
óC3 B3ó
úC3 BAú
üC3 BCü
¿C2 BF¿
¡C2 A1¡
€E2 82 AC€
’ (curly apostrophe)E2 80 99’
“ (curly quote)E2 80 9C“
— (em dash)E2 80 94—

The opposite mistake looks different. A file saved as Windows-1252 or Latin-1 stores ñ as the single byte F1, which is not valid UTF-8 on its own, so a UTF-8 reader shows the replacement character instead: “Espa�a”. Rule of thumb: à and  pairs mean UTF-8 read as 1252; lone � diamonds mean 1252 read as UTF-8.

Excel — open a UTF-8 CSV correctly:
  Data → From Text/CSV → File origin: 65001 : Unicode (UTF-8)
Excel — save so other tools read it correctly:
  File → Save As → "CSV UTF-8 (Comma delimited)"

Python — repair text that is already mangled (UTF-8 read as 1252):
"España".encode("cp1252").decode("utf-8")   # "España"
# messier cases: pip install ftfy, then ftfy.fix_text(s)

Python — read a legacy Windows file without the � marks:
open("data.csv", encoding="cp1252").read()

HTML — declare the encoding at the top of <head>:
<meta charset="utf-8">
Fix it at the source when you can (re-export as UTF-8); repair after the fact only when the original is gone.