Text to ASCII Codes
Convert text to ASCII or Unicode character codes in decimal, hex, octal or binary, and turn lists of codes back into text.
Tool guide
What this tool does
Text to ASCII Codes lists the numeric code of every character in your text, as strict ASCII, Unicode code points or UTF-8 bytes, in decimal, hexadecimal, octal or binary. It decodes code lists back to text and shows a character table that names invisible control characters such as CR, LF and TAB.
Every character a computer stores has a number. ASCII, standardised in 1963, assigns the numbers 0 to 127 to English letters, digits, punctuation and 33 control codes, so “A” is 65, “a” is 97 and a line feed is 10. Unicode keeps those first 128 values and extends the idea to more than 150,000 characters, from é (233) to 😀 (128512). Knowing the codes is essential when writing parsers, escaping characters in code, comparing strings that look identical, or completing programming exercises.
This tool shows the code for each character in the format you need. Choose decimal, hexadecimal, octal or binary, with optional 0x, 0o or 0b prefixes and zero padding. “ASCII only” stops with a clear message at the first non-ASCII character, “Unicode code points” gives one number per character even for emoji, and “UTF-8 bytes” lists the bytes actually stored in a file. Decoding accepts codes separated by spaces, commas or new lines, as well as prefixed forms such as 0x41, A or U+0041. A character table names control characters. Everything runs locally.
How to use Text to ASCII Codes
- Type or paste text, or a list of codes, into the Input box.
- Select “Text to codes” or “Codes to text” under Mode.
- Choose the Number format: decimal, hexadecimal, octal or binary.
- Pick the Code type: ASCII only, Unicode code points or UTF-8 bytes.
- Set the Separator, prefixes and padding, then copy the result and review the character table below it.
Tips for better results
- Upper- and lower-case ASCII letters differ by exactly 32, so “A” (65) plus 32 is “a” (97).
- Digits 0-9 are codes 48-57, so subtracting 48 from a digit’s code gives its value.
- Look for codes 13 and 10 to tell Windows line endings (CR LF) from Unix ones (LF only).
- A code of 160 is a non-breaking space, which looks like a normal space (32) but breaks many comparisons.
Common use cases
- Finding the hidden character that makes two seemingly identical strings unequal.
- Building a lookup table or test data for a parser or tokenizer exercise.
- Decoding a list of decimal codes from a puzzle or CTF challenge.
- Writing key codes or byte values into firmware or a serial protocol script.
Common mistakes to avoid
- Calling characters such as é or € “extended ASCII”; their codes depend on the code page, so use Unicode code points instead.
- Mixing up code points and UTF-8 bytes: é is the single code point 233 but the two bytes 195 169.
- Pasting decimal codes without separators, which cannot be split reliably. The tool asks for a separator in that case.
Frequently asked questions
What is the ASCII code of a space?
A normal space is 32 (hex 20). A non-breaking space is Unicode 160 (hex A0), which is not part of ASCII.
Does it work with emoji?
Yes, in the Unicode code points and UTF-8 bytes modes. An emoji such as 😀 is one code point, 128512 (U+1F600), and four UTF-8 bytes.
Which formats can I paste when decoding?
Numbers separated by spaces, commas, semicolons or new lines, optionally with prefixes such as 0x, 0b, 0o, U+, \u, \x or HTML references like A. Choose the matching number format first.
Feedback & suggestions
Help us improve Text to ASCII Codes. We read every message.