Skip to content
AgileLogics

Decimal to ASCII

Decodes space-separated decimal ASCII codes and Unicode code points (233 is é, up to 1114111) back into readable text.

How it works

Enter space-separated decimal codes (e.g. 72 105) and click Convert.

How do you convert decimal codes to ASCII text?

Each decimal number stands for one character, so you look up every number and write down its character: 72 is H, 105 is i. This converter does the lookup for a whole list at once. Paste numbers separated by spaces or line breaks and it returns the text, using ASCII for 0 to 127 and Unicode code points above that.

Try 80 121 116 104 111 110. The output is Python.

Where these numbers usually come from

Most decimal code lists are printed by a program, and each language has its own pair of functions for going between characters and numbers. Knowing which one produced your list matters, because some return code points and some return bytes or UTF-16 units:

Language Character to number Number to character What the number is
Python ord('é') gives 233 chr(233) Unicode code point (docs)
JavaScript codePointAt(0) String.fromCodePoint() Unicode code point (MDN)
JavaScript charCodeAt(0) String.fromCharCode() UTF-16 code unit
PHP ord('é') gives 195 chr() A single byte, so only the first UTF-8 byte
PHP mb_ord('é') gives 233 mb_chr() Unicode code point (manual)
Python list('é'.encode()) gives 195, 169 bytes([...]).decode() UTF-8 bytes

This tool behaves like the code point rows: it is the equivalent of mapping String.fromCodePoint over your list. Output from any of the code point functions pastes straight in. For plain English text all the rows agree, because ASCII characters have the same number in every scheme.

Decoding a list from a log or a debugger

  1. Copy the numbers. If they came from an array like [72, 101, 121], strip the brackets and commas first, since only whitespace is accepted as a separator. A find and replace of , with a space does it.
  2. Paste them into the input box. Line breaks between numbers are fine, and extra spaces are ignored.
  3. Click Convert.
  4. If the result has odd pairs like é where you expected accented letters or symbols, your list is UTF-8 bytes rather than code points. See the next section.

Bytes versus code points

This is the mistake behind most "wrong character" results. Compare two lists that both claim to spell café:

Input Output Why
99 97 102 233 café 233 is the code point of é
99 97 102 195 169 café 195 and 169 are the two UTF-8 bytes of é, each read as its own character

The second list is perfectly valid UTF-8, just in the wrong form for this tool. 195 happens to be the code point of à and 169 of ©, so you get the classic garbled look. To decode byte lists properly, convert each byte to hex and use hex to text, which reassembles multi-byte UTF-8 sequences. The encoding rules themselves are in RFC 3629.

UTF-16 lists have a similar quirk. JavaScript's charCodeAt reports an emoji as two numbers, a surrogate pair. The tool recognises a complete pair and joins it: 55357 56397 decodes to 👍, the same as the single code point 128077.

Range and validation

The tool accepts whole numbers from 0 to 1114111, the full Unicode code space ending at U+10FFFF. Inside that range every number produces a character, including ones you might not expect:

  • 0 to 31 and 127 are control codes. 9 is a tab and 10 starts a new line; most others are invisible in the output box.
  • 128 to 159 are also control characters in Unicode, not printable symbols. The exception is 55296 to 57343, the surrogate halves. They only mean something as a high-then-low pair, as above, so one on its own (say 55296, or 56397 55357 in the wrong order) is rejected with an error naming the number.

Input is rejected with "Enter space-separated decimal ASCII codes, e.g. 72 105." if any item contains something other than digits: a comma, a minus sign, a decimal point, a letter or a 0x prefix. Leading zeros are allowed, so 072 105 still gives Hi.

A number above 1114111 gets its own message, such as "1114112 is not a valid character code — Unicode code points run from 0 to 1114111." Whatever the error, the output box is cleared, so a stale result from an earlier conversion is never left on screen.

Going the other way

To produce a code list from text, use ASCII to decimal. For hexadecimal codes, which is what most byte dumps use, hex to ASCII is the matching decoder.

Last updated

Frequently asked questions

How do I convert decimal numbers to ASCII characters?
Enter the codes separated by spaces or line breaks, such as 72 105, and click Convert. Each number is treated as a character code, so 72 becomes H and 105 becomes i. In code, Python's chr(72) and JavaScript's String.fromCodePoint(72) do the same thing.
Why do I get é instead of é?
Your numbers are UTF-8 bytes, not character codes. In UTF-8, é is stored as the two bytes 195 and 169, but this tool reads each number as a whole character, so 195 is à and 169 is ©. Use the character's code point (233) instead, or convert the bytes to hex and use the Hex to Text converter, which decodes UTF-8.
What is the largest number I can enter?
1114111, the highest Unicode code point (U+10FFFF). A larger number gives an error that names it, for example 1114112 is not a valid character code, and nothing is decoded until you fix or remove it.
Can I use commas or hex values like 0x48?
No. Only plain decimal digits separated by whitespace are accepted. Commas, minus signs, decimal points and 0x prefixes give the error Enter space-separated decimal ASCII codes, e.g. 72 105. Leading zeros are fine, so 072 is read as 72.
Is anything sent to a server?
No. Decoding happens in your browser.