ASCII table and converter
All 128 ASCII codes in decimal, hex, octal and binary, plus a converter from text to ASCII codes and back. Free, no sign-up, and it runs in your browser.
Decimal codes
13 characters
72 101 108 108 111 44 32 87 111 114 108 100 33
ASCII table
All 128 ASCII codes with decimal, hex, octal and binary values. Search by character, name, number (65, 0x41) or control code (ESC, ^C).
What this ASCII table does
The page has two parts. The converter at the top turns text into ASCII codes, or a list of codes back into text, as you type. Pick decimal, hex, binary or octal, and copy the result with one click. Below it is the full ASCII table: all 128 codes with their decimal, hex, octal and binary values, the character, its name, and its HTML code. Control codes also show their caret notation (such as ^C) and their C escape sequence (such as \n).
Everything runs in your browser. Nothing you type is stored or sent anywhere.
How to use it
- To get the codes for some text, keep Text to ASCII selected, choose a number base, and type or paste your text. The codes show below, separated by spaces.
- To read codes, select ASCII to text and paste the numbers. Spaces, commas, semicolons and new lines all work as separators, and hex codes can have a
0xprefix. If one item is not a valid number, the tool tells you which one. - Select Swap to send the result back into the input and switch direction, which is a quick way to check a round trip.
- To look up a single character, search the table. Type the character itself, its name (
tab,bracket), its decimal or hex code (65,0x41), its binary code, or a control code such asESCor^C. Use the filter to show only the printable or only the control characters.
How ASCII is laid out
ASCII is a 7-bit character code, so it has 128 codes, from 0 to 127. RFC 20, which is still an Internet Standard, describes it for network use as "standard 7-bit ASCII embedded in an 8 bit byte whose high order bit is always 0".1 That is why every binary code in the table starts with a 0 when you write it as a full byte.
- Codes 0 to 31 and 127 are control codes. They were made to control devices such as printers and terminals, not to print. A few are still in daily use: 9 is tab, 10 is line feed (the new line on Linux and macOS), 13 is carriage return (Windows ends lines with 13 then 10), and 27 is escape, which starts terminal color codes. RFC 20 lists the name of each one.1
- Codes 32 to 126 are the 95 printable characters: the space, punctuation, the digits 0 to 9 (48 to 57), the uppercase letters (65 to 90) and the lowercase letters (97 to 122). MDN counts 33 non-printing control codes and 95 printable characters.2
The layout has useful patterns. A lowercase letter is its uppercase letter plus 32, so only one bit changes between A (1000001) and a (1100001). A digit's code minus 48 gives its value. And the caret notation of a control code is the character 64 places above it: code 3 is ^C because C is 67, which is why Ctrl+C sends code 3 in a terminal.
ASCII in code
In JavaScript, 'A'.charCodeAt(0) returns 65, and String.fromCharCode(72, 105) returns "Hi". Note that charCodeAt returns a UTF-16 code unit from 0 to 65535, so for characters outside the Basic Multilingual Plane, such as most emoji, MDN says to use codePointAt instead.3 fromCharCode takes UTF-16 code units in the same way.4 This converter reads whole code points, so an emoji stays one character with one code.
In HTML, any character can be written as a numeric reference, such as & for the ampersand. The HTML standard also defines named references such as &, <, > and '.5 The table shows the numeric form for every character and the named form for the ones you most often need to escape.
If you work with key events, the keycode finder shows a related set of numbers: the letter keys A to Z have the keyCodes 65 to 90, the same as the uppercase ASCII codes. To make random IDs or tokens from a safe set of ASCII characters, use the random string generator.
More free tools
Keycode finder
Keycode finder that runs in your browser. Press any key to see its JavaScript keyCode, key, code and location, and copy a ready keydown handler.
Image converter
Image converter that runs in your browser. Convert PNG, JPG, WebP, AVIF, GIF and SVG files in bulk, with quality and resize options. No uploads.
HTML to Markdown converter
HTML to Markdown converter that runs in your browser. Paste HTML or rich text from a web page, Google Docs or Word and get clean GitHub Markdown.
Test credit card numbers generator
Test credit card numbers for form and checkout tests, made in your browser. Generate valid-format numbers for 7 card networks and check any number.
PX to REM converter
PX to REM converter that runs in your browser. Convert px to rem and rem to px at any root font size, or convert a whole stylesheet at once.
Random string generator
Random string generator that runs in your browser. Make secure random strings, API keys and tokens with your own length, characters and prefix.
Frequently asked questions
Sources
RFC Editor: RFC 20: ASCII format for network interchange
MDN Web Docs: ASCII (Glossary)
MDN Web Docs: String.prototype.charCodeAt()
MDN Web Docs: String.fromCharCode()