Free tool

ASCII table

ASCII maps 128 characters to the numbers 0-127: 33 control codes and 95 printable characters. The table below lists every code in decimal, hex, octal and binary, with its HTML entity, string escape and name. Search by character, by code in any notation (65, 0x41, %41, A) or by name, and click a row to copy any format. Below the table, convert text to codes and back.

Free · no sign-up · runs in your browser, nothing is uploaded

128 shown
text to codes ↓
ASCII table (0-127)
DecCharHexOctBinaryHTMLDescription

Text to ASCII codes

Text
Decimal codes

Codes appear here.

What is ASCII?

ASCII (American Standard Code for Information Interchange) was first published in the US in 1963 and last revised as ANSI X3.4-1986. It is a 7-bit code: 128 values, each stored in a byte whose top bit is 0. RFC 20 (1969) adopted it for data sent over the ARPANET, and protocols like HTTP and email headers still use it.

Range (dec)HexWhat is there
0-3100-1FControl codes: NUL, tab, line feed, carriage return, escape...
3220Space
33-47, 58-64, 91-96, 123-12621-2F, 3A-40, 5B-60, 7B-7EPunctuation and symbols
48-5730-39Digits 0-9
65-9041-5AUppercase A-Z
97-12261-7ALowercase a-z
1277FDEL, a control code

Unicode starts with the same 128 characters, and UTF-8 stores them as the same single bytes, so plain ASCII text is valid UTF-8.

Control characters you still meet

Most of the 33 control codes came from teleprinters and are unused today. These are the ones that still matter:

DecNameEscape / keyUsed for today
0NUL\0End of a C string; padding in binary formats
7BEL\aMakes a terminal beep or flash
8BS\bBackspace: moves the cursor back one column
9HT\tTab
10LF\nNew line on Linux and macOS
13CR\rSent by Enter; CR LF ends lines on Windows and in HTTP
3ETXCtrl+CTerminals turn it into an interrupt (SIGINT)
4EOTCtrl+DEnd of input in a Unix terminal
27ESC\x1BStarts ANSI escape sequences for colors and cursor moves
127DELCtrl+?Sent by the Backspace key in many terminals

Caret notation (^C, ^[) names a control code by the key you press with Ctrl. Ctrl keeps only the low 5 bits of the key's code, so C (67) becomes 3 and [ (91) becomes 27, which is why Ctrl+[ works as Escape in Vim. ^? is the exception: it means DEL, 127.

Handy patterns in the ASCII table

  • Case is one bit. A lowercase letter is its uppercase letter plus 32 (bit 5, 0x20). c ^ 0x20 flips the case of an ASCII letter and c | 0x20 makes it lowercase.
  • Digits are 48-57. c - 48 (or c - '0' in C) turns a digit character into its value.
  • Uppercase sorts first. Plain byte comparison puts "Zebra" before "apple", because Z (90) is less than a (97). Use a locale-aware compare for human sorting.
  • Hex digits are not contiguous. 0-9 are 48-57 but A-F are 65-70, so hex parsing needs two ranges.
  • Not every symbol has a named HTML entity. ˜ is the small tilde U+02DC, not ~ (126), and the hyphen-minus (45) has none. Use ~ or the character itself.

Get ASCII codes in JavaScript, Python, C and bash

// JavaScript
'A'.charCodeAt(0)          // 65
'😀'.codePointAt(0)        // 128512 (use codePointAt beyond ASCII)
String.fromCharCode(72, 105)  // "Hi"
[...'Hi'].map(c => c.charCodeAt(0).toString(16))  // ['48', '69']
# Python
ord('A')                  # 65
chr(97)                   # 'a'
'Hi'.encode('ascii')      # b'Hi'  (raises UnicodeEncodeError for é)
[hex(b) for b in b'Hi']   # ['0x48', '0x69']
/* C */
char c = 'A';
printf("%d %x %c\n", c, c, c + 32);   /* 65 41 a */
# bash
printf '%d\n' "'A"        # 65
printf '\x41\n'           # A
printf 'Hi' | xxd         # 00000000: 4869  Hi
man ascii                 # the full table in your terminal (Linux)

Extended ASCII and mojibake

Bytes 128-255 are outside ASCII, and different encodings put different characters there. Windows-1252 has € at 0x80 and curly quotes at 0x91-0x94, where ISO-8859-1 has invisible C1 control codes. From 0xA0 up, both match Unicode U+00A0-U+00FF. In UTF-8, these characters take two or more bytes instead of one.

That mismatch causes mojibake. The UTF-8 bytes for é are C3 A9; read as Windows-1252 they show as é. If you see that, the text is UTF-8 and the reader picked the wrong encoding. Declare charset=utf-8 in the Content-Type header or <meta charset="utf-8">.

For characters beyond ASCII, use the Unicode converter. To turn text into bits, try text to binary or the binary converter, and to escape strings for JSON, HTML or a shell, the string escape tool. For editors, linters and other code tools, browse code tools on DevHunt.

FAQ

How many characters are in ASCII?+

ASCII has 128 codes, 0 to 127. 95 of them are printable (space, digits, letters and punctuation, codes 32 to 126) and 33 are control codes (0 to 31 and 127, DEL).

What is the ASCII code for A?+

Uppercase A is 65 in decimal, 0x41 in hex, 101 in octal and 01000001 in binary. Lowercase a is 97 (0x61). Every lowercase letter is its uppercase letter plus 32.

What is the ASCII value of a space?+

Space is 32 in decimal and 0x20 in hex. It is the first printable character. In URLs it is encoded as %20, and in HTML forms as +.

What is the ASCII code for Enter or a new line?+

The Enter key usually sends Carriage Return, 13 (0x0D, \r). A new line in a text file is Line Feed, 10 (0x0A, \n) on Linux and macOS, and the pair CR LF (13 10, \r\n) on Windows and in HTTP headers.

What is ASCII code 0?+

Code 0 is NUL, the null character. It prints nothing. C and many other languages use it to mark the end of a string, which is why it often shows up as \0.

Is ASCII 7-bit or 8-bit?+

ASCII is a 7-bit code. Computers store each character in an 8-bit byte with the top bit set to 0. Bytes 128 to 255 are not ASCII; their meaning depends on the encoding, such as Windows-1252, ISO-8859-1 or UTF-8.

What is the difference between ASCII and Unicode?+

Unicode covers every writing system, with over a million possible code points. Its first 128 code points are exactly ASCII. In UTF-8, those 128 characters are stored as the same single bytes, so any ASCII file is also valid UTF-8.

What is extended ASCII?+

Extended ASCII is a loose name for 8-bit encodings that keep ASCII in 0-127 and add 128 more characters in 128-255. There is no single extended ASCII: Windows-1252, ISO-8859-1 and the old DOS code page 437 all put different characters there. Turn on the 128-255 table in the tool to compare the two most common ones.

Sources: RFC 20: ASCII format for network interchange · Unicode C0 Controls and Basic Latin chart · WHATWG HTML named character references · WHATWG Encoding: windows-1252 · Unicode: Windows-1252 mapping · MDN: String.prototype.charCodeAt() · Python: ord(). Checked 2026-10-31.