Skip to content
TextArray

ASCII table

ASCII assigns a number to 128 characters — the digits, the unaccented Latin letters, common punctuation, and 33 control codes that were never meant to be printed. Every one of them is listed below in decimal, hexadecimal, octal and binary, with its HTML entity number.

The first 32 codes and the last one are controls. Most are historical, from an era of teleprinters and paper tape, but a handful still run everything you type: 9 is Tab, 10 is the Unix newline, 13 is the carriage return that Windows pairs with it, and 27 starts every ANSI escape sequence your terminal uses for colour.

ASCII is the first 128 code points of Unicode, unchanged, which is why it is still the common denominator of nearly every encoding in use. UTF-8 was designed so that any pure-ASCII file is already valid UTF-8, byte for byte.

Control codes

0–31, 127

DecHexOctBinaryCharHTMLName
00000000000000NUL�NullString terminator in C. Not a printable character.
10100100000001SOHStart of headingHistorical; framed the header of a transmission block.
20200200000010STXStart of textHistorical; marked where the message body began.
30300300000011ETXEnd of textSent by Ctrl+C, which is why that key interrupts a program.
40400400000100EOTEnd of transmissionSent by Ctrl+D; closes stdin in a Unix shell.
50500500000101ENQEnquiryHistorical; asked the far end to identify itself.
60600600000110ACKAcknowledgePositive response in older serial protocols.
70700700000111BELBellRings the terminal bell. Written \a in C.
80801000001000BSBackspaceMoves the cursor back one column. Written \b.
90901100001001HT	Horizontal tabThe Tab key. Written \t.
100A01200001010LF
Line feedThe Unix newline. Written \n.
110B01300001011VTVertical tabRare; advances to the next vertical tab stop. Written \v.
120C01400001100FFForm feedPage break for printers. Written \f.
130D01500001101CR
Carriage returnReturns to column one. Paired with LF on Windows. Written \r.
140E01600001110SOShift outHistorical; switched to an alternate character set.
150F01700001111SIShift inHistorical; switched back to the standard set.
161002000010000DLEData link escapeHistorical; made the next bytes control data.
171102100010001DC1Device control 1XON — resumes a paused transmission. Sent by Ctrl+Q.
181202200010010DC2Device control 2Historical device control.
191302300010011DC3Device control 3XOFF — pauses transmission. Sent by Ctrl+S.
201402400010100DC4Device control 4Historical device control.
211502500010101NAKNegative acknowledgeNegative response in older serial protocols.
221602600010110SYNSynchronous idleFilled silence on synchronous links.
231702700010111ETBEnd of transmission blockHistorical; ended one block of a longer message.
241803000011000CANCancelDiscards the data sent before it.
251903100011001EMEnd of mediumMarked the physical end of a tape or card deck.
261A03200011010SUBSubstituteEnd-of-file marker in DOS and CP/M. Sent by Ctrl+Z.
271B03300011011ESCEscapeStarts an ANSI escape sequence — terminal colours and cursor moves.
281C03400011100FSFile separatorCoarsest of the four data separators.
291D03500011101GSGroup separatorSeparates groups within a file.
301E03600011110RSRecord separatorSeparates records within a group.
311F03700011111USUnit separatorFinest separator; occasionally used as a field delimiter.
1277F17701111111DELDeleteAll bits punched on paper tape, which is why it is at the top.

Space

32

DecHexOctBinaryCharHTMLName
322004000100000  Space

Punctuation and symbols

33–47, 58–64, 91–96, 123–126

DecHexOctBinaryCharHTMLName
332104100100001!!Exclamation mark
342204200100010""Quotation mark
352304300100011##Number sign
362404400100100$$Dollar sign
372504500100101%%Percent sign
382604600100110&&Ampersand
392704700100111''Apostrophe
402805000101000((Left parenthesis
412905100101001))Right parenthesis
422A05200101010**Asterisk
432B05300101011++Plus sign
442C05400101100,,Comma
452D05500101101--Hyphen-minus
462E05600101110..Full stop
472F05700101111//Solidus
583A07200111010::Colon
593B07300111011;&#59;Semicolon
603C07400111100<&#60;Less-than sign
613D07500111101=&#61;Equals sign
623E07600111110>&#62;Greater-than sign
633F07700111111?&#63;Question mark
644010001000000@&#64;Commercial at
915B13301011011[&#91;Left square bracket
925C13401011100\&#92;Reverse solidus
935D13501011101]&#93;Right square bracket
945E13601011110^&#94;Circumflex accent
955F13701011111_&#95;Low line
966014001100000`&#96;Grave accent
1237B17301111011{&#123;Left curly bracket
1247C17401111100|&#124;Vertical line
1257D17501111101}&#125;Right curly bracket
1267E17601111110~&#126;Tilde

Digits

48–57

DecHexOctBinaryCharHTMLName
4830060001100000&#48;Digit 0
4931061001100011&#49;Digit 1
5032062001100102&#50;Digit 2
5133063001100113&#51;Digit 3
5234064001101004&#52;Digit 4
5335065001101015&#53;Digit 5
5436066001101106&#54;Digit 6
5537067001101117&#55;Digit 7
5638070001110008&#56;Digit 8
5739071001110019&#57;Digit 9

Letters

65–90, 97–122

DecHexOctBinaryCharHTMLName
654110101000001A&#65;Capital letter A
664210201000010B&#66;Capital letter B
674310301000011C&#67;Capital letter C
684410401000100D&#68;Capital letter D
694510501000101E&#69;Capital letter E
704610601000110F&#70;Capital letter F
714710701000111G&#71;Capital letter G
724811001001000H&#72;Capital letter H
734911101001001I&#73;Capital letter I
744A11201001010J&#74;Capital letter J
754B11301001011K&#75;Capital letter K
764C11401001100L&#76;Capital letter L
774D11501001101M&#77;Capital letter M
784E11601001110N&#78;Capital letter N
794F11701001111O&#79;Capital letter O
805012001010000P&#80;Capital letter P
815112101010001Q&#81;Capital letter Q
825212201010010R&#82;Capital letter R
835312301010011S&#83;Capital letter S
845412401010100T&#84;Capital letter T
855512501010101U&#85;Capital letter U
865612601010110V&#86;Capital letter V
875712701010111W&#87;Capital letter W
885813001011000X&#88;Capital letter X
895913101011001Y&#89;Capital letter Y
905A13201011010Z&#90;Capital letter Z
976114101100001a&#97;Small letter a
986214201100010b&#98;Small letter b
996314301100011c&#99;Small letter c
1006414401100100d&#100;Small letter d
1016514501100101e&#101;Small letter e
1026614601100110f&#102;Small letter f
1036714701100111g&#103;Small letter g
1046815001101000h&#104;Small letter h
1056915101101001i&#105;Small letter i
1066A15201101010j&#106;Small letter j
1076B15301101011k&#107;Small letter k
1086C15401101100l&#108;Small letter l
1096D15501101101m&#109;Small letter m
1106E15601101110n&#110;Small letter n
1116F15701101111o&#111;Small letter o
1127016001110000p&#112;Small letter p
1137116101110001q&#113;Small letter q
1147216201110010r&#114;Small letter r
1157316301110011s&#115;Small letter s
1167416401110100t&#116;Small letter t
1177516501110101u&#117;Small letter u
1187616601110110v&#118;Small letter v
1197716701110111w&#119;Small letter w
1207817001111000x&#120;Small letter x
1217917101111001y&#121;Small letter y
1227A17201111010z&#122;Small letter z

FAQ

What is the difference between ASCII and UTF-8?
ASCII defines 128 characters, numbered 0 to 127. UTF-8 is an encoding for the whole of Unicode — over 150,000 characters — and it encodes those first 128 as single bytes with exactly the ASCII values. So every ASCII file is a valid UTF-8 file, but the reverse only holds if the text stays inside those 128 characters.
Why does the table stop at 127?
ASCII is a 7-bit standard, and 2⁷ is 128. Codes 128–255 are not ASCII: they belong to whichever 8-bit extension is in play — Windows-1252, ISO-8859-1, and others — which is precisely why they disagree with each other and why text with accents arrives mangled so often.
What is the ASCII code for space?
Decimal 32, hex 20. It is a printable character despite looking like nothing, which is why it sits outside the control range that ends at 31.
Why is DEL at 127 instead of 0?
Paper tape. Deleting a character meant punching out every hole in its position, and all seven bits punched is 127. A deleted character could not be un-deleted, which is also where the modern meaning comes from.
What is the difference between CR and LF?
CR (13) returns the print head to column one; LF (10) advances one line. Unix and macOS end lines with LF alone, Windows uses CR followed by LF, and that disagreement is the reason a file can show up as one long line or with stray ^M characters.