ASCII Table

Every ASCII character with its decimal, hex, octal, binary and HTML code, and a lookup for any character.

Codes in any base — 65, 0x41, 0b1000001, 0o101 or A — and names like newline, DEL or question mark. Beyond 127, any Unicode code point comes back with its UTF-8 bytes.

Every character, 0 to 127

DecHexCharNameDescription
000^@Null · NULNothing at all: a byte of zero. C ends its strings with it.
101^AStart of Heading · SOHStart of heading: opens the header of a transmission.
202^BStart of Text · STXStart of text: closes the header and opens the message.
303^CEnd of Text · ETXEnd of text: closes the message. Ctrl+C sends it to interrupt a program.
404^DEnd of Transmission · EOTEnd of transmission: there is no more. Ctrl+D ends shell input the same way.
505^EEnquiry · ENQEnquiry: asks the far end to answer with its identity.
606^FAcknowledge · ACKAcknowledge: received, go ahead.
707^GBell · BELBell: makes the terminal beep.
808^HBackspace · BSBackspace: moves the cursor one place back.
909^IHorizontal Tab · HTHorizontal tab: jumps to the next tab stop. It is \t in strings.
100A^JLine Feed · LFLine feed: down one line. The newline of Unix text, and \n in strings.
110B^KVertical Tab · VTVertical tab: down to the next vertical tab stop. It is \v in strings.
120C^LForm Feed · FFForm feed: pushes a fresh page. It is \f in strings.
130D^MCarriage Return · CRCarriage return: back to the start of the line. Windows ends its lines with CR then LF.
140E^NShift Out · SOShift out: switches to the alternative character set until Shift In arrives.
150F^OShift In · SIShift in: switches back to the standard character set.
1610^PData Link Escape · DLEData link escape: the next byte is a link command, not data.
1711^QDevice Control 1 · DC1Device control 1: XON — resumes output that XOFF paused. Ctrl+Q.
1812^RDevice Control 2 · DC2Device control 2: in paper-tape days, switched the reader back on.
1913^SDevice Control 3 · DC3Device control 3: XOFF — pauses output until XON arrives. Ctrl+S still does it in terminals.
2014^TDevice Control 4 · DC4Device control 4: in paper-tape days, switched the reader off.
2115^UNegative Acknowledge · NAKNegative acknowledge: received, but wrong — send it again.
2216^VSynchronous Idle · SYNSynchronous idle: a filler that keeps a synchronous line in step.
2317^WEnd of Transmission Block · ETBEnd of transmission block: a block of data ends here.
2418^XCancel · CANCancel: throws away what was sent since the last block.
2519^YEnd of Medium · EMEnd of medium: the tape or paper has run out.
261A^ZSubstitute · SUBSubstitute: stands in for a character that arrived damaged. Ctrl+Z ends input on Windows.
271B^[Escape · ESCEscape: what follows is a command, not text. Ctrl+[ is the Esc key’s code.
281C^\File Separator · FSFile separator: divides files in a stream of data.
291D^]Group Separator · GSGroup separator: divides groups of records.
301E^^Record Separator · RSRecord separator: divides records within a group.
311F^_Unit Separator · USUnit separator: divides fields within a record.
3220␣Space · SPThe space between words. Invisible, but it takes a byte like any other character.
3321!Exclamation mark
3422"Quotation mark
3523#Number sign
3624$Dollar sign
3725%Percent sign
3826&Ampersand
3927'Apostrophe
4028(Left parenthesis
4129)Right parenthesis
422A*Asterisk
432B+Plus sign
442C,Comma
452D-Hyphen
462E.Full stop
472F/Solidus
48300Digit zero
49311Digit one
50322Digit two
51333Digit three
52344Digit four
53355Digit five
54366Digit six
55377Digit seven
56388Digit eight
57399Digit nine
583A:Colon
593B;Semicolon
603C<Less-than sign
613D=Equals sign
623E>Greater-than sign
633F?Question mark
6440@Commercial at
6541ACapital A
6642BCapital B
6743CCapital C
6844DCapital D
6945ECapital E
7046FCapital F
7147GCapital G
7248HCapital H
7349ICapital I
744AJCapital J
754BKCapital K
764CLCapital L
774DMCapital M
784ENCapital N
794FOCapital O
8050PCapital P
8151QCapital Q
8252RCapital R
8353SCapital S
8454TCapital T
8555UCapital U
8656VCapital V
8757WCapital W
8858XCapital X
8959YCapital Y
905AZCapital Z
915B[Left square bracket
925C\Backslash
935D]Right square bracket
945E^Circumflex accent
955F_Underscore
9660`Grave accent
9761aSmall a
9862bSmall b
9963cSmall c
10064dSmall d
10165eSmall e
10266fSmall f
10367gSmall g
10468hSmall h
10569iSmall i
1066AjSmall j
1076BkSmall k
1086ClSmall l
1096DmSmall m
1106EnSmall n
1116FoSmall o
11270pSmall p
11371qSmall q
11472rSmall r
11573sSmall s
11674tSmall t
11775uSmall u
11876vSmall v
11977wSmall w
12078xSmall x
12179ySmall y
1227AzSmall z
1237B{Left curly bracket
1247C|Vertical bar
1257D}Right curly bracket
1267E~Tilde
1277F^?Delete · DELDelete: in paper-tape days it punched every hole to erase a character. Now it erases.

Codes 0–31 and 127 are the control characters: they print nothing, so the table shows their caret notation and abbreviation instead. Codes 128 to 255 are not ASCII at all — look one up above and it arrives as a Unicode code point with its UTF-8 bytes.

Runs in your browser. Nothing you enter is sent anywhere.

How to use it

The full chart is under Every character, 0 to 127: decimal, hex, the character, its name and what each control character does.

To look one up, type into Look up a character, a code or a name:

  • one character: A, é, €, or a single space
  • a code in any base: 65, 0x41, 0b1000001, 0o101, or an HTML reference like &#65; or &#x41;
  • a name, abbreviation or everyday word: line feed, LF, newline, enter, less than sign

A card shows its decimal, hexadecimal, octal and binary values, HTML reference and UTF-8 bytes, and Copy the character copies it. Part of a name, three letters or more, lists every match: feed finds Line Feed and Form Feed.

Examples

newline gives Line Feed (LF), shown as ^J:

Decimal      10
Hexadecimal  0A
Octal        012
Binary       00001010
HTML         &#10;
UTF-8 bytes  0A

€ is beyond ASCII, so it comes back as code point 8364:

Decimal      8364
Hexadecimal  20AC
Octal        20254
Binary       0010000010101100
HTML         &#8364;
UTF-8 bytes  E2 82 AC

128 is not the euro sign but U+0080, a C1 control with the UTF-8 bytes C2 80. Its HTML row reads None: HTML reads &#128; as a different character. Browsers turn &#128; into € because byte 0x80 is € in Windows-1252.

7 is the digit seven, code 55. For code 7, the bell, type 07, 0x07 or bell.

❤️ is rejected with “❤️” is one character made of 2 code points, 0x2764 and 0xFE0F: look them up one at a time. The second code point is the selector that asks for the emoji style.

Good to know

  • ASCII has 128 codes, 0 to 127. It’s a 7-bit code, standardized as ANSI X3.4 and US-ASCII. Codes 32 to 126 print; 0 to 31 and 127 are control characters.
  • Caret notation is how terminals show control characters. ^ plus the character 64 codes higher: code 3 is ^C, code 27 (Escape) is ^[, and DEL is ^?. Ctrl with that key sends the code, so Ctrl+C sends 3.
  • Line endings are control characters. Unix ends lines with LF (\n, 10); Windows uses CR then LF (\r\n, 13 10).
  • There is no single extended ASCII. Codes 128 to 255 differ by code page: Latin-1, Windows-1252, DOS code page 437. Here, any code above 127 is a Unicode code point; 128 to 255 match Latin-1.
  • ASCII text is already UTF-8. Codes 0 to 127 are one byte each in UTF-8, unchanged. Every other code point takes two to four bytes, each from 0x80 up.
  • A lookup is up to 40 characters, and code points run from 0 to 0x10FFFF, without the surrogates 0xD800 to 0xDFFF.

Questions

What is the ASCII code for A?

Capital A is 65, or 0x41 in hex; small a is 97, or 0x61. Every capital letter is 32 below its small letter, so the two cases differ by one bit.

How do I convert a character to its ASCII code in code?

In JavaScript, 'A'.codePointAt(0) gives 65, and .toString(16) makes it 41. In Python, ord('A') gives 65 and hex(ord('A')) gives '0x41'; in a shell, printf '%x\n' "'A" prints 41.

What is the difference between ASCII and Unicode?

ASCII is 128 characters; Unicode has room for 1,114,112 code points, and its first 128 are ASCII. UTF-8, the usual way to store Unicode, keeps ASCII text byte for byte.