ASCII Table

All 128 ASCII codes in decimal, hex, octal and binary. Type a character, a number or a name to find its row.

Try
128 codes

Control characters (0 to 31)

DecHexOctBinaryCharName
00000000000000NULNull
10100100000001SOHStart of heading
20200200000010STXStart of text
30300300000011ETXEnd of text
40400400000100EOTEnd of transmission
50500500000101ENQEnquiry
60600600000110ACKAcknowledge
70700700000111BELBell
80801000001000BSBackspace
90901100001001HTHorizontal tab
100A01200001010LFLine feed
110B01300001011VTVertical tab
120C01400001100FFForm feed
130D01500001101CRCarriage return
140E01600001110SOShift out
150F01700001111SIShift in
161002000010000DLEData link escape
171102100010001DC1Device control 1
181202200010010DC2Device control 2
191302300010011DC3Device control 3
201402400010100DC4Device control 4
211502500010101NAKNegative acknowledge
221602600010110SYNSynchronous idle
231702700010111ETBEnd of transmission block
241803000011000CANCancel
251903100011001EMEnd of medium
261A03200011010SUBSubstitute
271B03300011011ESCEscape
281C03400011100FSFile separator
291D03500011101GSGroup separator
301E03600011110RSRecord separator
311F03700011111USUnit separator

Space, symbols and digits (32 to 63)

DecHexOctBinaryCharName
322004000100000SPSpace
332104100100001!Exclamation mark
342204200100010"Double quote
352304300100011#Number sign (hash)
362404400100100$Dollar sign
372504500100101%Percent sign
382604600100110&Ampersand
392704700100111'Apostrophe (single quote)
402805000101000(Left parenthesis
412905100101001)Right parenthesis
422A05200101010*Asterisk
432B05300101011+Plus sign
442C05400101100,Comma
452D05500101101-Hyphen-minus
462E05600101110.Full stop (period)
472F05700101111/Slash
4830060001100000Digit 0
4931061001100011Digit 1
5032062001100102Digit 2
5133063001100113Digit 3
5234064001101004Digit 4
5335065001101015Digit 5
5436066001101106Digit 6
5537067001101117Digit 7
5638070001110008Digit 8
5739071001110019Digit 9
583A07200111010:Colon
593B07300111011;Semicolon
603C07400111100<Less-than sign
613D07500111101=Equals sign
623E07600111110>Greater-than sign
633F07700111111?Question mark

Capital letters (64 to 95)

DecHexOctBinaryCharName
644010001000000@At sign
654110101000001ACapital letter A
664210201000010BCapital letter B
674310301000011CCapital letter C
684410401000100DCapital letter D
694510501000101ECapital letter E
704610601000110FCapital letter F
714710701000111GCapital letter G
724811001001000HCapital letter H
734911101001001ICapital letter I
744A11201001010JCapital letter J
754B11301001011KCapital letter K
764C11401001100LCapital letter L
774D11501001101MCapital letter M
784E11601001110NCapital letter N
794F11701001111OCapital letter O
805012001010000PCapital letter P
815112101010001QCapital letter Q
825212201010010RCapital letter R
835312301010011SCapital letter S
845412401010100TCapital letter T
855512501010101UCapital letter U
865612601010110VCapital letter V
875712701010111WCapital letter W
885813001011000XCapital letter X
895913101011001YCapital letter Y
905A13201011010ZCapital letter Z
915B13301011011[Left square bracket
925C13401011100\Backslash
935D13501011101]Right square bracket
945E13601011110^Caret
955F13701011111_Underscore

Small letters and DEL (96 to 127)

DecHexOctBinaryCharName
966014001100000`Grave accent (backtick)
976114101100001aSmall letter a
986214201100010bSmall letter b
996314301100011cSmall letter c
1006414401100100dSmall letter d
1016514501100101eSmall letter e
1026614601100110fSmall letter f
1036714701100111gSmall letter g
1046815001101000hSmall letter h
1056915101101001iSmall letter i
1066A15201101010jSmall letter j
1076B15301101011kSmall letter k
1086C15401101100lSmall letter l
1096D15501101101mSmall letter m
1106E15601101110nSmall letter n
1116F15701101111oSmall letter o
1127016001110000pSmall letter p
1137116101110001qSmall letter q
1147216201110010rSmall letter r
1157316301110011sSmall letter s
1167416401110100tSmall letter t
1177516501110101uSmall letter u
1187616601110110vSmall letter v
1197716701110111wSmall letter w
1207817001111000xSmall letter x
1217917101111001ySmall letter y
1227A17201111010zSmall letter z
1237B17301111011{Left curly brace
1247C17401111100|Vertical bar (pipe)
1257D17501111101}Right curly brace
1267E17601111110~Tilde
1277F17701111111DELDelete

How to read the table

ASCII is a numbered list of 128 characters. Each row is one entry, and the first four columns are the same number written four ways. Capital A is 65 in decimal, 41 in hex, 101 in octal and01000001 in binary.

Binary is shown as a full 8-bit byte. ASCII itself needs only seven bits, so the first digit is always 0. Of the 128 codes, 95 are printable, from the space at 32 to the tilde at 126. The other 33 are control characters: codes 0 to 31, plus DEL at 127.

In HTML, you can write any printable character by its number. &#65; uses the decimal code and&#x41; uses the hex code. Both show a capital A.

Patterns worth remembering

Digits start at 48

The character 0 is code 48, and the other digits follow in order. To get a digit's value from its code, subtract 48. In hex it's even easier: the digits run from 30 to 39, so the second hex digit is the value.

Capital and small letters are 32 apart

A is 65 and a is 97. The same gap holds for every letter. In binary, 32 is a single bit, so flipping that one bit switches a letter between capital and small.

Letters count from 1

The last five bits of a letter give its place in the alphabet. G ends in 00111, which is 7, and G is the seventh letter. This works for both cases.

Sorting follows the codes

A plain code-by-code sort puts digits first, then capital letters, then small letters. That's why such a sort places "Zebra" before "apple": Z is 90 and a is 97. It also puts "10" before "9", because it compares the character 1 with the character 9.

Control characters and the Ctrl key

The first 32 codes don't print anything. They were made to control printers, terminals and data links. Many terminals still send them when you hold Ctrl and press a key. For a letter, the code is its place in the alphabet, so Ctrl+A sends 1 and Ctrl+Z sends 26.

KeysCodeWhat it usually does
Ctrl+C3 ETXStops the running program in most terminals.
Ctrl+D4 EOTSignals the end of input on Linux and macOS.
Ctrl+H8 BSBackspace.
Ctrl+I9 HTTab.
Ctrl+M13 CRCarriage return, the code behind Enter in a terminal.
Ctrl+[27 ESCEscape. Vim users often press it in place of the Esc key.

Programs and desktop apps can give these keys other jobs. In most editors, Ctrl+C copies the selected text.

Line endings

Two control characters end lines of text. Linux and macOS use a line feed, code 10. Windows uses a carriage return, code 13, followed by a line feed. If a file shows stray characters at the end of each line, this difference is a likely cause.

What comes after 127?

Nothing, as far as ASCII goes. Tables sold as "extended ASCII" fill codes 128 to 255 in different ways. Latin-1, Windows-1252 and the old IBM PC code page 437 don't agree with each other, so a byte above 127 means nothing until you know which one was used.

Most text today uses UTF-8. It keeps all 128 ASCII codes exactly as they are here, and writes every other character as two to four bytes. So a plain ASCII file is already a valid UTF-8 file.

ASCII table FAQ

What is the ASCII code for A?

Capital A is 65 in decimal, 41 in hex and 01000001 in binary. Small a is 97, 61 in hex and 01100001.

What is the ASCII code for a space?

A space is 32 in decimal, 20 in hex and 00100000 in binary. It counts as a printable character even though you can't see it.

What is the ASCII code for Enter?

It depends on the system. A line break is usually stored as 10 (line feed) on Linux and macOS, and as 13 then 10 on Windows.

What does ASCII stand for?

American Standard Code for Information Interchange.

How many characters are in ASCII?

128, numbered 0 to 127. There are 95 printable characters and 33 control characters.