FormatterHQ

Text to ASCII Codes

List the character code of every letter in your text — in decimal, hex, octal, binary or as HTML references — with the separator of your choice.

Loading tool…
Ready.

How to use the Text to ASCII Codes

  1. Type or paste into the Text box, or click Sample. You can also drop a text file on either box, or load one into the ASCII codes box with its Open file button.
  2. The ASCII codes box updates live as you type. It works both ways — edit the ASCII codes side to convert back, or click ⇄ Swap to exchange the sides.
  3. Adjust Code format and Separator in the options bar above the editors; the result refreshes immediately.
  4. Use Copy or Download on either box to take the result, or Clear to start again.

Text to ASCII codes in five formats

Every character has a numeric code. The text to ASCII converter lists those codes for each character in your text, which is useful for programming exercises, protocol work, debugging hidden characters and building lookup tables.

Example

Input: Hello ASCII!

Code formatOutput
Decimal72 101 108 108 111 32 65 83 67 73 73 33
Hex0x48 0x69 0x21 (for “Hi!”)
Octal0110 0151 041 (for “Hi!”)
Binary01001000 01101001 00100001 (for “Hi!”)
HTMLH i ! (for “Hi!”)

Octal values use a leading 0 and hex values a 0x prefix, the conventions of C-family languages. Separators can be spaces, commas or new lines.

ASCII and Unicode

ASCII defines codes 0 to 127: control characters (0–31 and 127), the space (32), punctuation, digits (48–57), uppercase letters (65–90) and lowercase letters (97–122). Characters outside that range are not ASCII, so the tool outputs their Unicode code point instead. For example, “é” and “€” give 233, 8364. For ASCII characters the code point and the ASCII code are identical, so the output is always consistent.

Note that this is the code point, not the UTF-8 bytes. If you need the bytes, use String to Byte Array or String to Hex.

Hexadecimal is the most common notation in programming documentation and Unicode charts, decimal is used by HTML references and most ASCII tables, octal appears in older C code and Unix tools, and binary is mainly used for teaching and bit-level work.

Control characters you may see

CodeNameMeaning
0NULNull — string terminator in C
9TABHorizontal tab
10LFLine feed — Unix line ending
13CRCarriage return — part of Windows CRLF; the editor stores CRLF as one line feed, so it is not output
27ESCEscape — starts terminal colour codes
127DELDelete

Handy ASCII facts

  • Uppercase and lowercase letters differ by exactly 32 (A = 65, a = 97), which is why flipping bit 5 changes case.
  • The digit characters 0–9 are codes 48–57, so subtracting 48 converts a digit character to its value.
  • Line feed is 10 and tab 9; seeing them in the output helps locate stray line breaks and tabs. Carriage return (13) does not appear, because the editor stores every line break as a line feed.

Convert codes back with ASCII to Text. The conversion runs in your browser.

Frequently asked questions

What is the ASCII code for a space?
A space is 32 in decimal, 0x20 in hex, 040 in octal and 00100000 in binary.
Why do accented letters give numbers above 127?
They are not part of ASCII. The tool shows their Unicode code point, which for é is 233 and for € is 8364.
What is the difference between this and Char to ASCII?
Text to ASCII outputs a compact list of codes in one format. Char to ASCII shows a table with decimal, hex, octal, binary and HTML side by side for each character.
How do I get the codes as a code array?
Use Code to ASCII, which can wrap the codes in a JavaScript array, Python list or C array.

Last updated October 3, 2026

Related tools