ASCII Table
All 128 ASCII characters with decimal, hex, octal, binary and HTML codes — plus a converter that turns text into codes and back, showing the working.
ASCII Table
Text ↔ ASCII codes
0x41, 0b1000001, U+0041 and A also work. ASCII table (0–127)
Showing all 128 characters.
| Dec | Hex | Oct | Binary | Char | Description | HTML number | HTML name |
|---|---|---|---|---|---|---|---|
| 0 | 00 | 000 | 00000000 | NUL | Null Terminates strings in C; also used as padding or filler.
Caret ^@ · escape \0 | � † | none |
| 1 | 01 | 001 | 00000001 | SOH | Start of heading Began the header of a message in early data-transmission protocols.
Caret ^A |  † | none |
| 2 | 02 | 002 | 00000010 | STX | Start of text Separated a message header from its body in transmission protocols.
Caret ^B |  † | none |
| 3 | 03 | 003 | 00000011 | ETX | End of text Ctrl+C sends this code; Unix terminals turn it into an interrupt signal.
Caret ^C |  † | none |
| 4 | 04 | 004 | 00000100 | EOT | End of transmission Ctrl+D sends it; Unix terminals treat it as end of input.
Caret ^D |  † | none |
| 5 | 05 | 005 | 00000101 | ENQ | Enquiry Asked a remote station to identify itself or report its status.
Caret ^E |  † | none |
| 6 | 06 | 006 | 00000110 | ACK | Acknowledge Positive reply from a receiver: the data arrived correctly.
Caret ^F |  † | none |
| 7 | 07 | 007 | 00000111 | BEL | Bell Makes a terminal beep or flash.
Caret ^G · escape \a |  † | none |
| 8 | 08 | 010 | 00001000 | BS | Backspace Moves the cursor one position back.
Caret ^H · escape \b |  † | none |
| 9 | 09 | 011 | 00001001 | HT | Horizontal tab The Tab key; moves to the next tab stop.
Caret ^I · escape \t | 	 | 	 HTML5 |
| 10 | 0A | 012 | 00001010 | LF | Line feed Ends a line on Linux, macOS and other Unix-like systems. Windows text files and HTTP/1.1 headers use CR followed by LF.
Caret ^J · escape \n | | 
 HTML5 |
| 11 | 0B | 013 | 00001011 | VT | Vertical tab Moved a printer down to the next vertical tab stop; rarely used today.
Caret ^K · escape \v |  † | none |
| 12 | 0C | 014 | 00001100 | FF | Form feed Tells a printer to start a new page.
Caret ^L · escape \f |  | none |
| 13 | 0D | 015 | 00001101 | CR | Carriage return Returns the cursor to the start of the line. Paired with LF (CR LF) as the line ending on Windows and in HTTP/1.1 and email headers; classic Mac OS used CR alone.
Caret ^M · escape \r | † | none |
| 14 | 0E | 016 | 00001110 | SO | Shift out Switched a device to an alternate character set.
Caret ^N |  † | none |
| 15 | 0F | 017 | 00001111 | SI | Shift in Switched back to the standard character set after SO.
Caret ^O |  † | none |
| 16 | 10 | 020 | 00010000 | DLE | Data link escape Changed the meaning of the characters that follow in transmission protocols.
Caret ^P |  † | none |
| 17 | 11 | 021 | 00010001 | DC1 | Device control 1 Used as XON (resume sending) in software flow control; Ctrl+Q.
Caret ^Q |  † | none |
| 18 | 12 | 022 | 00010010 | DC2 | Device control 2 Device-specific control function.
Caret ^R |  † | none |
| 19 | 13 | 023 | 00010011 | DC3 | Device control 3 Used as XOFF (pause sending) in software flow control; Ctrl+S.
Caret ^S |  † | none |
| 20 | 14 | 024 | 00010100 | DC4 | Device control 4 Device-specific control function.
Caret ^T |  † | none |
| 21 | 15 | 025 | 00010101 | NAK | Negative acknowledge Negative reply from a receiver: the data was not received correctly.
Caret ^U |  † | none |
| 22 | 16 | 026 | 00010110 | SYN | Synchronous idle Kept synchronous transmission links in step when no data was being sent.
Caret ^V |  † | none |
| 23 | 17 | 027 | 00010111 | ETB | End of transmission block Marked the end of a block of data in transmission protocols.
Caret ^W |  † | none |
| 24 | 18 | 030 | 00011000 | CAN | Cancel Indicated that the preceding data is in error and should be ignored.
Caret ^X |  † | none |
| 25 | 19 | 031 | 00011001 | EM | End of medium Marked the physical end of a tape or other storage medium.
Caret ^Y |  † | none |
| 26 | 1A | 032 | 00011010 | SUB | Substitute Stands in for an invalid character. Ctrl+Z sends it; DOS and Windows text mode treat it as end of file.
Caret ^Z |  † | none |
| 27 | 1B | 033 | 00011011 | ESC | Escape Starts terminal escape sequences, such as the ANSI codes for colors and cursor movement.
Caret ^[ |  † | none |
| 28 | 1C | 034 | 00011100 | FS | File separator Information separator four: the highest-level data delimiter.
Caret ^\ |  † | none |
| 29 | 1D | 035 | 00011101 | GS | Group separator Information separator three: separates groups of records.
Caret ^] |  † | none |
| 30 | 1E | 036 | 00011110 | RS | Record separator Information separator two: separates records. Also begins each record in JSON text sequences (RFC 7464).
Caret ^^ |  † | none |
| 31 | 1F | 037 | 00011111 | US | Unit separator Information separator one: separates fields within a record.
Caret ^_ |  † | none |
| 32 | 20 | 040 | 00100000 | SP | Space Counted as a printable (graphic) character, not a control code, even though it prints nothing. |   | none |
| 33 | 21 | 041 | 00100001 | ! | Exclamation mark | ! | ! HTML5 |
| 34 | 22 | 042 | 00100010 | " | Quotation mark (double quote) | " | " also " |
| 35 | 23 | 043 | 00100011 | # | Number sign (hash) | # | # HTML5 |
| 36 | 24 | 044 | 00100100 | $ | Dollar sign | $ | $ HTML5 |
| 37 | 25 | 045 | 00100101 | % | Percent sign | % | % HTML5 |
| 38 | 26 | 046 | 00100110 | & | Ampersand | & | & also & |
| 39 | 27 | 047 | 00100111 | ' | Apostrophe (single quote) | ' | ' |
| 40 | 28 | 050 | 00101000 | ( | Left parenthesis | ( | ( HTML5 |
| 41 | 29 | 051 | 00101001 | ) | Right parenthesis | ) | ) HTML5 |
| 42 | 2A | 052 | 00101010 | * | Asterisk | * | * HTML5 also * |
| 43 | 2B | 053 | 00101011 | + | Plus sign | + | + HTML5 |
| 44 | 2C | 054 | 00101100 | , | Comma | , | , HTML5 |
| 45 | 2D | 055 | 00101101 | - | Hyphen-minus | - | none |
| 46 | 2E | 056 | 00101110 | . | Full stop (period) | . | . HTML5 |
| 47 | 2F | 057 | 00101111 | / | Solidus (slash) | / | / HTML5 |
| 48 | 30 | 060 | 00110000 | 0 | Digit zero | 0 | none |
| 49 | 31 | 061 | 00110001 | 1 | Digit one | 1 | none |
| 50 | 32 | 062 | 00110010 | 2 | Digit two | 2 | none |
| 51 | 33 | 063 | 00110011 | 3 | Digit three | 3 | none |
| 52 | 34 | 064 | 00110100 | 4 | Digit four | 4 | none |
| 53 | 35 | 065 | 00110101 | 5 | Digit five | 5 | none |
| 54 | 36 | 066 | 00110110 | 6 | Digit six | 6 | none |
| 55 | 37 | 067 | 00110111 | 7 | Digit seven | 7 | none |
| 56 | 38 | 070 | 00111000 | 8 | Digit eight | 8 | none |
| 57 | 39 | 071 | 00111001 | 9 | Digit nine | 9 | none |
| 58 | 3A | 072 | 00111010 | : | Colon | : | : HTML5 |
| 59 | 3B | 073 | 00111011 | ; | Semicolon | ; | ; HTML5 |
| 60 | 3C | 074 | 00111100 | < | Less-than sign | < | < also < |
| 61 | 3D | 075 | 00111101 | = | Equals sign | = | = HTML5 |
| 62 | 3E | 076 | 00111110 | > | Greater-than sign | > | > also > |
| 63 | 3F | 077 | 00111111 | ? | Question mark | ? | ? HTML5 |
| 64 | 40 | 100 | 01000000 | @ | Commercial at | @ | @ HTML5 |
| 65 | 41 | 101 | 01000001 | A | Latin capital letter A | A | none |
| 66 | 42 | 102 | 01000010 | B | Latin capital letter B | B | none |
| 67 | 43 | 103 | 01000011 | C | Latin capital letter C | C | none |
| 68 | 44 | 104 | 01000100 | D | Latin capital letter D | D | none |
| 69 | 45 | 105 | 01000101 | E | Latin capital letter E | E | none |
| 70 | 46 | 106 | 01000110 | F | Latin capital letter F | F | none |
| 71 | 47 | 107 | 01000111 | G | Latin capital letter G | G | none |
| 72 | 48 | 110 | 01001000 | H | Latin capital letter H | H | none |
| 73 | 49 | 111 | 01001001 | I | Latin capital letter I | I | none |
| 74 | 4A | 112 | 01001010 | J | Latin capital letter J | J | none |
| 75 | 4B | 113 | 01001011 | K | Latin capital letter K | K | none |
| 76 | 4C | 114 | 01001100 | L | Latin capital letter L | L | none |
| 77 | 4D | 115 | 01001101 | M | Latin capital letter M | M | none |
| 78 | 4E | 116 | 01001110 | N | Latin capital letter N | N | none |
| 79 | 4F | 117 | 01001111 | O | Latin capital letter O | O | none |
| 80 | 50 | 120 | 01010000 | P | Latin capital letter P | P | none |
| 81 | 51 | 121 | 01010001 | Q | Latin capital letter Q | Q | none |
| 82 | 52 | 122 | 01010010 | R | Latin capital letter R | R | none |
| 83 | 53 | 123 | 01010011 | S | Latin capital letter S | S | none |
| 84 | 54 | 124 | 01010100 | T | Latin capital letter T | T | none |
| 85 | 55 | 125 | 01010101 | U | Latin capital letter U | U | none |
| 86 | 56 | 126 | 01010110 | V | Latin capital letter V | V | none |
| 87 | 57 | 127 | 01010111 | W | Latin capital letter W | W | none |
| 88 | 58 | 130 | 01011000 | X | Latin capital letter X | X | none |
| 89 | 59 | 131 | 01011001 | Y | Latin capital letter Y | Y | none |
| 90 | 5A | 132 | 01011010 | Z | Latin capital letter Z | Z | none |
| 91 | 5B | 133 | 01011011 | [ | Left square bracket | [ | [ HTML5 also [ |
| 92 | 5C | 134 | 01011100 | \ | Reverse solidus (backslash) | \ | \ HTML5 |
| 93 | 5D | 135 | 01011101 | ] | Right square bracket | ] | ] HTML5 also ] |
| 94 | 5E | 136 | 01011110 | ^ | Circumflex accent (caret) | ^ | ^ HTML5 |
| 95 | 5F | 137 | 01011111 | _ | Low line (underscore) | _ | _ HTML5 also _ |
| 96 | 60 | 140 | 01100000 | ` | Grave accent (backtick) | ` | ` HTML5 also ` |
| 97 | 61 | 141 | 01100001 | a | Latin small letter a | a | none |
| 98 | 62 | 142 | 01100010 | b | Latin small letter b | b | none |
| 99 | 63 | 143 | 01100011 | c | Latin small letter c | c | none |
| 100 | 64 | 144 | 01100100 | d | Latin small letter d | d | none |
| 101 | 65 | 145 | 01100101 | e | Latin small letter e | e | none |
| 102 | 66 | 146 | 01100110 | f | Latin small letter f | f | none |
| 103 | 67 | 147 | 01100111 | g | Latin small letter g | g | none |
| 104 | 68 | 150 | 01101000 | h | Latin small letter h | h | none |
| 105 | 69 | 151 | 01101001 | i | Latin small letter i | i | none |
| 106 | 6A | 152 | 01101010 | j | Latin small letter j | j | none |
| 107 | 6B | 153 | 01101011 | k | Latin small letter k | k | none |
| 108 | 6C | 154 | 01101100 | l | Latin small letter l | l | none |
| 109 | 6D | 155 | 01101101 | m | Latin small letter m | m | none |
| 110 | 6E | 156 | 01101110 | n | Latin small letter n | n | none |
| 111 | 6F | 157 | 01101111 | o | Latin small letter o | o | none |
| 112 | 70 | 160 | 01110000 | p | Latin small letter p | p | none |
| 113 | 71 | 161 | 01110001 | q | Latin small letter q | q | none |
| 114 | 72 | 162 | 01110010 | r | Latin small letter r | r | none |
| 115 | 73 | 163 | 01110011 | s | Latin small letter s | s | none |
| 116 | 74 | 164 | 01110100 | t | Latin small letter t | t | none |
| 117 | 75 | 165 | 01110101 | u | Latin small letter u | u | none |
| 118 | 76 | 166 | 01110110 | v | Latin small letter v | v | none |
| 119 | 77 | 167 | 01110111 | w | Latin small letter w | w | none |
| 120 | 78 | 170 | 01111000 | x | Latin small letter x | x | none |
| 121 | 79 | 171 | 01111001 | y | Latin small letter y | y | none |
| 122 | 7A | 172 | 01111010 | z | Latin small letter z | z | none |
| 123 | 7B | 173 | 01111011 | { | Left curly bracket | { | { HTML5 also { |
| 124 | 7C | 174 | 01111100 | | | Vertical line (pipe) | | | | HTML5 also | | |
| 125 | 7D | 175 | 01111101 | } | Right curly bracket | } | } HTML5 also } |
| 126 | 7E | 176 | 01111110 | ~ | Tilde | ~ | none |
| 127 | 7F | 177 | 01111111 | DEL | Delete All seven bits are 1, so on punched paper tape it could overwrite (rub out) any character. Not the same as Backspace.
Caret ^? |  † | none |
No ASCII character matches that search. ASCII stops at 127 — characters such as é or € are Unicode; type them in the converter above to see their code points.
HTML columns: &, <, >, " and
' are the five entities predefined in XML, so they also work in XHTML and SVG. Names tagged HTML5 work only in
HTML. † Writing a control character (other than tab, line feed and form feed) as a numeric reference is a parse error in HTML;
browsers still decode it, except �, which becomes U+FFFD (�).
How to use the ASCII table and converter
Type or paste text in the Text box to get its codes, or type codes in the Codes box to turn
them back into text — each box updates the other. Pick decimal, hex, binary or octal and the codes are rewritten in that base.
The working below the boxes breaks every character into its binary place values. Unseparated byte strings such as
48656C6C6F or 0100100001101001 are split into bytes automatically.
The table lists all 128 ASCII characters. Filter it by typing a character, a code in any base, an abbreviation such as
ESC, a word such as bracket, or an entity such as <, or use the buttons to show
only control characters, letters, digits or symbols.
How to read the codes
Each character has one number. The decimal, hexadecimal, octal and binary columns are the same number written in base 10, 16, 8 and 2. In binary, every position is a power of two, so:
code = b₆×64 + b₅×32 + b₄×16 + b₃×8 + b₂×4 + b₁×2 + b₀×1
One hex digit stands for exactly four bits and one octal digit for three, which is why programmers prefer hex: 0100 0001
is 4 and 1, so A is hex 41.
Worked example: “Hi!”
This is the example the converter shows before you type anything:
- H = 72 = 64 + 8 → binary
01001000, hex48, octal110 - i = 105 = 64 + 32 + 8 + 1 → binary
01101001, hex69, octal151 - ! = 33 = 32 + 1 → binary
00100001, hex21, octal041
So “Hi!” is 72 105 33 in decimal and 48 69 21 in hex — three characters, three bytes. To practice the
conversions by hand, try the binary to decimal and
hex to decimal converters.
Control characters and printable characters
Codes 0–31 and 127 are the 33 control characters. They were designed to drive teleprinters and data links — ring a bell, return the carriage, mark the end of a transmission — rather than to be printed. A few are still everywhere: tab (9), line feed (10), carriage return (13), escape (27, which starts terminal color codes) and NUL (0, the end of a C string). DEL (127) is all seven bits set to 1, so on punched paper tape it could overwrite any mistake.
Codes 32–126 are the 95 printable characters: the space, the digits, the 26 capital and 26 small letters, and 32 punctuation marks and symbols. The layout is deliberate. Digits start at 48 (hex 30), so a digit’s value is its code minus 48. Capital letters start at 65 and small letters at 97, exactly 32 apart: changing case flips a single bit (bit 5), which is how simple case conversion works for English text.
A short history of ASCII
ASCII — the American Standard Code for Information Interchange — was first published in 1963 as ASA X3.4-1963 by the American Standards Association, the body that later became ANSI. It is a 7-bit code, giving 128 values. The 1963 edition had no small letters; they were added in the 1967 revision, and the standard was last revised as ANSI X3.4-1986. The same repertoire was adopted internationally as ISO/IEC 646.
In 1969, RFC 20 by Vint Cerf proposed ASCII for the ARPANET, the Internet’s predecessor, using “7-bit ASCII embedded in an 8 bit byte whose high order bit is always 0” — which is why the binary column above always starts with 0. RFC 20 is now Internet Standard STD 80, and protocols such as HTTP still define their syntax in terms of ASCII.
ASCII, Unicode and UTF-8
Unicode kept ASCII as its first block: code points U+0000 to U+007F are exactly the 128 ASCII characters in the same order. UTF-8, the encoding used by almost every web page, writes those code points as one byte each with the same value, and writes every other character as two to four bytes that are all 128 or higher. So plain ASCII text is already valid UTF-8, and a byte below 128 in UTF-8 always means the ASCII character in this table.
Anything else is not ASCII. The converter shows such characters as Unicode code points and lists their UTF-8 bytes — for example,
é is U+00E9, stored as the two bytes C3 A9. If those bytes are wrongly read as Windows-1252 they appear as “é”, the familiar
garbled-text problem. Other common non-ASCII look-alikes are curly quotes (’ is U+2019), the en dash (– is U+2013) and the no-break
space (U+00A0, ).
Common mistakes
- The digit 0 is not NUL. The character “0” is code 48; code 0 is the invisible NUL control character.
- Line endings differ. LF on Linux and macOS, CR LF on Windows — convert when a file’s lines look joined or show
^M. - “ASCII” files with é or € in them are really UTF-8 or a legacy code page; ASCII stops at 127.
- Escaping HTML: only
&and<must be escaped in text (and quotes inside attribute values); everything else can be typed as-is in a UTF-8 page.
More web references: HTML color codes and HTTP status codes, or count characters with the word counter.
Frequently asked questions
How many characters are there in ASCII?
Exactly 128, numbered 0 to 127, because ASCII is a 7-bit code (2⁷ = 128). 33 are control characters (0–31 and 127) and 95 are printable (32–126, counting the space).
What is the ASCII code for A, a, 0 and space?
Capital A is 65 (hex 41), small a is 97 (hex 61), the digit 0 is 48 (hex 30) and the space is 32 (hex 20). Capital and small letters are always exactly 32 apart.
Is ASCII the same as UTF-8?
Not quite, but every ASCII file is also a valid UTF-8 file. UTF-8 stores the 128 ASCII characters as single bytes with the same values, and uses two to four bytes, each 128 or higher, for every other character. See the Unicode section below.
What is “extended ASCII”?
A loose name for 8-bit character sets that use codes 128–255 for extra characters, such as ISO-8859-1 (Latin-1) and Windows-1252. They do not agree with each other, and none of them is ASCII, which stops at 127. Today UTF-8 is the usual choice instead.
What is the difference between CR, LF and CRLF?
LF (line feed, 10, \n) ends lines on Linux and macOS. CR (carriage return, 13, \r) followed by LF — CRLF — ends lines in Windows text files and in HTTP/1.1 and email headers. Mixing them is a classic cause of stray ^M characters and failed diffs.
Sources
- RFC 20: ASCII format for Network Interchange (STD 80) — RFC Editor
- The Unicode Standard: C0 Controls and Basic Latin code chart (PDF)
- RFC 3629: UTF-8, a transformation format of ISO 10646 — RFC Editor
- HTML Standard: Named character references — WHATWG
- IEEE Milestone: American Standard Code for Information Interchange (ASCII), 1963 — ETHW