Home › Developer Tools › ASCII Table

ASCII Table

Look up any ASCII code from 0 to 127, plus the extended 128–255 range in Windows-1252 or ISO-8859-1, in decimal, hex, octal, binary and HTML. Search, click to copy, and convert text to codes, all in your browser.

DecHexOctBinaryCharHTMLDescription

Click a character to see all its codes, or click any value in the table to copy it.

Text to ASCII codes

Advertisement

How to use the ASCII Table

  1. Browse the standard 0–127 table, or switch to Extended 128–255 or All 0–255.
  2. Search by typing a character (A), a code (65, 0x41, 01000001), an entity (&) or a name such as tab or euro.
  3. Click a character to see every representation in the detail card, then click a value to copy it.
  4. Pick the extended set: Windows-1252 (what most Western Windows text uses) or ISO-8859-1 with C1 control codes.
  5. Convert text to ASCII codes in the panel below the table, or copy or download the table as CSV.

How ASCII codes are organized

ASCII is a 7-bit code, so every character fits in the values 0 to 127 (binary 0000000 to 1111111). The layout is not random: it is arranged in blocks of 32, which is why so many tricks work with a single bit.

Range (dec)HexContents
0–3100–1FControl characters (NUL, TAB, LF, CR, ESC…)
32–4720–2FSpace and punctuation: ! " # $ % & ' ( ) * + , - . /
48–5730–39Digits 0–9 (the digit's value is code − 48)
58–643A–40: ; < = > ? @
65–9041–5AUppercase letters A–Z
91–965B–60[ \ ] ^ _ `
97–12261–7ALowercase letters a–z
123–1267B–7E{ | } ~
1277FDEL (delete) control character

Useful consequences: the case of a letter is bit 5 (value 32), so 'a' − 'A' = 32 and XOR with 0x20 toggles case. Holding Ctrl on a terminal clears bits 5 and 6, so Ctrl+M sends 13 (carriage return), Ctrl+I sends 9 (tab) and Ctrl+[ sends 27 (escape). That is where the caret notation in the table (^M, ^I, ^[) comes from.

Control characters you still meet today

  • LF (10, \n) ends lines on Linux and macOS; CR LF (13 10, \r\n) ends lines on Windows and in HTTP and email headers. Mixing them causes the classic "^M" at line ends; the line ending converter fixes that.
  • HT (9, \t) is the tab used in TSV files and Makefiles.
  • ESC (27, \x1b) starts ANSI escape sequences such as \x1b[31m for red terminal text.
  • NUL (0, \0) terminates strings in C and is often a sign of binary or UTF-16 data when it shows up in text.
  • BEL (7) beeps a terminal, BS (8) moves back one character, and DEL (127) was originally used to punch out mistakes on paper tape (all seven holes).

Windows-1252 vs ISO-8859-1

Both code pages agree with ASCII for 0–127 and with each other for 160–255, where you find é (233), ü (252), ñ (241), © (169) and the no-break space (160). They differ only in 128–159: ISO-8859-1 reserves it for rarely used C1 control codes, while Windows-1252 places 27 printable characters there, including € (128), … (133), ‘ ’ “ ” (145–148), • (149), – (150), — (151) and ™ (153); five codes (129, 141, 143, 144, 157) are unused. Because so much text labeled as Latin-1 was really written on Windows, the HTML standard tells browsers to decode ISO-8859-1 as Windows-1252. If you see “’” instead of an apostrophe, UTF-8 text was decoded as Windows-1252; the text encoding converter can repair such files.

Frequently asked questions

What is ASCII?

ASCII (American Standard Code for Information Interchange) is a 7-bit character encoding from 1963 that assigns the numbers 0 to 127 to 33 control characters and 95 printable characters: the space, digits, upper and lower case English letters and common punctuation. The first 128 code points of Unicode and UTF-8 are identical to ASCII.

What is the ASCII code for A, a, 0 and space?

Uppercase A is 65 (hex 41), lowercase a is 97 (hex 61), the digit 0 is 48 (hex 30) and the space is 32 (hex 20). Upper and lower case letters differ by exactly 32, which is a single bit (0x20).

What is extended ASCII?

There is no single extended ASCII. Codes 128 to 255 depend on the code page. ISO-8859-1 (Latin-1) puts C1 control codes at 128–159 and accented letters and symbols at 160–255. Windows-1252 uses the same 160–255 but puts printable characters such as €, curly quotes, the en dash and ™ at 128–159. This table lets you switch between both.

What are ASCII control characters?

Codes 0 to 31 and 127 are non-printing control characters that were designed to control teleprinters and data links. A few are still used every day: 9 (tab), 10 (line feed, new line on Linux and macOS), 13 (carriage return, CR LF on Windows), 27 (escape, used in terminal color codes) and 0 (null, the string terminator in C).

How do I write an ASCII character in HTML?

Use a numeric character reference: &#65; or &#x41; for A. A few characters have named entities that you must use in text: &amp; for &, &lt; for < and &gt; for >, and &quot; inside attribute values. For Windows-1252 characters such as €, use the Unicode code point (&#8364;), not the code page number 128.

What is the difference between ASCII and UTF-8?

UTF-8 is a Unicode encoding that stores the 128 ASCII characters as the same single bytes, so plain ASCII text is already valid UTF-8. Characters above 127 take 2 to 4 bytes in UTF-8, unlike single-byte code pages such as Windows-1252.

Related tools