bitlvl
EN

ASCII table

Search by character, number or name. Control characters show the Ctrl-key that sends them, which explains why Ctrl-C is 3 and Ctrl-D is 4.

 
 
DecHexOctBinaryCharNameCtrlHTMLURL
00000000000000NULNull^@�%00
10100100000001SOHStart of heading^A%01
20200200000010STXStart of text^B%02
30300300000011ETXEnd of text (Ctrl-C)^C%03
40400400000100EOTEnd of transmission (Ctrl-D)^D%04
50500500000101ENQEnquiry^E%05
60600600000110ACKAcknowledge^F%06
70700700000111BELBell / alert (\a)^G%07
80801000001000BSBackspace (\b)^H%08
90901100001001HTHorizontal tab (\t)^I	%09
100A01200001010LFLine feed, newline (\n)^J
%0A
110B01300001011VTVertical tab (\v)^K%0B
120C01400001100FFForm feed (\f)^L%0C
130D01500001101CRCarriage return (\r)^M
%0D
140E01600001110SOShift out^N%0E
150F01700001111SIShift in^O%0F
161002000010000DLEData link escape^P%10
171102100010001DC1Device control 1 (XON, Ctrl-Q)^Q%11
181202200010010DC2Device control 2^R%12
191302300010011DC3Device control 3 (XOFF, Ctrl-S)^S%13
201402400010100DC4Device control 4^T%14
211502500010101NAKNegative acknowledge^U%15
221602600010110SYNSynchronous idle^V%16
231702700010111ETBEnd of transmission block^W%17
241803000011000CANCancel^X%18
251903100011001EMEnd of medium^Y%19
261A03200011010SUBSubstitute (Ctrl-Z, EOF on DOS)^Z%1A
271B03300011011ESCEscape (\e, starts terminal sequences)^[%1B
281C03400011100FSFile separator^\%1C
291D03500011101GSGroup separator^]%1D
301E03600011110RSRecord separator^^%1E
311F03700011111USUnit separator^_%1F
322004000100000 Space %20
332104100100001!Exclamation mark!%21
342204200100010"Double quote"%22
352304300100011#Number sign, hash#%23
362404400100100$Dollar$%24
372504500100101%Percent%%25
382604600100110&Ampersand&%26
392704700100111'Apostrophe, single quote'%27
402805000101000(Left parenthesis(%28
412905100101001)Right parenthesis)%29
422A05200101010*Asterisk*%2A
432B05300101011+Plus+%2B
442C05400101100,Comma,%2C
452D05500101101-Hyphen-minus-%2D
462E05600101110.Full stop, period.%2E
472F05700101111/Slash/%2F
4830060001100000Digit 00%30
4931061001100011Digit 11%31
5032062001100102Digit 22%32
5133063001100113Digit 33%33
5234064001101004Digit 44%34
5335065001101015Digit 55%35
5436066001101106Digit 66%36
5537067001101117Digit 77%37
5638070001110008Digit 88%38
5739071001110019Digit 99%39
583A07200111010:Colon:%3A
593B07300111011;Semicolon&#59;%3B
603C07400111100<Less-than&lt;%3C
613D07500111101=Equals&#61;%3D
623E07600111110>Greater-than&gt;%3E
633F07700111111?Question mark&#63;%3F
644010001000000@At sign&#64;%40
654110101000001ACapital A&#65;%41
664210201000010BCapital B&#66;%42
674310301000011CCapital C&#67;%43
684410401000100DCapital D&#68;%44
694510501000101ECapital E&#69;%45
704610601000110FCapital F&#70;%46
714710701000111GCapital G&#71;%47
724811001001000HCapital H&#72;%48
734911101001001ICapital I&#73;%49
744A11201001010JCapital J&#74;%4A
754B11301001011KCapital K&#75;%4B
764C11401001100LCapital L&#76;%4C
774D11501001101MCapital M&#77;%4D
784E11601001110NCapital N&#78;%4E
794F11701001111OCapital O&#79;%4F
805012001010000PCapital P&#80;%50
815112101010001QCapital Q&#81;%51
825212201010010RCapital R&#82;%52
835312301010011SCapital S&#83;%53
845412401010100TCapital T&#84;%54
855512501010101UCapital U&#85;%55
865612601010110VCapital V&#86;%56
875712701010111WCapital W&#87;%57
885813001011000XCapital X&#88;%58
895913101011001YCapital Y&#89;%59
905A13201011010ZCapital Z&#90;%5A
915B13301011011[Left square bracket&#91;%5B
925C13401011100\Backslash&#92;%5C
935D13501011101]Right square bracket&#93;%5D
945E13601011110^Caret, circumflex&#94;%5E
955F13701011111_Underscore&#95;%5F
966014001100000`Grave accent, backtick&#96;%60
976114101100001aSmall a&#97;%61
986214201100010bSmall b&#98;%62
996314301100011cSmall c&#99;%63
1006414401100100dSmall d&#100;%64
1016514501100101eSmall e&#101;%65
1026614601100110fSmall f&#102;%66
1036714701100111gSmall g&#103;%67
1046815001101000hSmall h&#104;%68
1056915101101001iSmall i&#105;%69
1066A15201101010jSmall j&#106;%6A
1076B15301101011kSmall k&#107;%6B
1086C15401101100lSmall l&#108;%6C
1096D15501101101mSmall m&#109;%6D
1106E15601101110nSmall n&#110;%6E
1116F15701101111oSmall o&#111;%6F
1127016001110000pSmall p&#112;%70
1137116101110001qSmall q&#113;%71
1147216201110010rSmall r&#114;%72
1157316301110011sSmall s&#115;%73
1167416401110100tSmall t&#116;%74
1177516501110101uSmall u&#117;%75
1187616601110110vSmall v&#118;%76
1197716701110111wSmall w&#119;%77
1207817001111000xSmall x&#120;%78
1217917101111001ySmall y&#121;%79
1227A17201111010zSmall z&#122;%7A
1237B17301111011{Left curly brace&#123;%7B
1247C17401111100|Vertical bar, pipe&#124;%7C
1257D17501111101}Right curly brace&#125;%7D
1267E17601111110~Tilde&#126;%7E
1277F17701111111DELDelete (DEL)^?&#127;%7F

The structure of ASCII

ASCII (1963, revised 1967) is a 7-bit code: 128 values, of which 33 are control characters and 95 are printable. Its layout was designed for mechanical teleprinters and bit-twiddling hardware, and the design still shows:

  • Case is one bit. A is 0x41, a is 0x61: they differ only in bit 5 (value 32). c | 0x20 lower-cases a letter, c & ~0x20 upper-cases it, and c ^ 0x20 toggles.
  • Digits are their value plus 48. '7' - '0' is 7, and the low nibble of a digit's code is the digit itself (0x37 → 7).
  • Ctrl clears two bits. Ctrl-C sends 0x03 because C is 0x43 and the terminal clears bits 6 and 5 (c & 0x1F). That is why Ctrl-D is EOT (4), Ctrl-H is backspace (8), Ctrl-I is tab (9), Ctrl-M is carriage return (13), Ctrl-[ is Escape (27) and Ctrl-@ is NUL.
  • DEL is 127, all seven bits set, because punching every hole in a paper tape was how you deleted a character.

Beyond 127

There is no “extended ASCII”. Bytes 128–255 meant different characters in every code page (Latin-1, Windows-1252, CP437, KOI8-R, ISO-8859-2 for Serbian Latin), which is the source of mojibake like “é” for “é”. Unicode replaced all of them; UTF-8 keeps bytes 0–127 identical to ASCII and uses 2–4 bytes above that. The Unicode inspector shows those bytes.

Line endings

Unix ends lines with LF (10); Windows with CR LF (13 10); classic Mac OS used CR alone. Teleprinters needed both: carriage return to move the head back, line feed to advance the paper. \r\n in a shell script's shebang line is still the most common cause of “bad interpreter” errors.

Questions

What is the ASCII code for A?

65 in decimal, 0x41 in hex, 0101 in octal, 01000001 in binary. Lower-case a is 97 (0x61).

What is ASCII 10 and 13?

10 is LF (line feed, \n) and 13 is CR (carriage return, \r). Unix uses LF alone; Windows uses CR LF.

Why does Ctrl-C send 3?

Terminals clear the two high bits of the letter’s code: C is 0x43 = 0100 0011, and 0x43 & 0x1F = 3 (ETX, end of text). The shell maps ETX to SIGINT.

Is 0xFF or 255 ASCII?

No. ASCII ends at 127. 128–255 depend on the code page, and in UTF-8 those byte values only occur as parts of multi-byte characters.