Skip to content

Text to ASCII

Convert characters to decimal ASCII codes.

Input
Output

No result

About Text to ASCII

Text to ASCII reports the decimal code point of each character, space-separated — A becomes 65, a becomes 97, and the digits run from 48 to 57. Decimal code points are the form used in most language documentation and in HTML numeric character references, which is why it remains the convention even though hex is more common for raw byte work.

The distinction between a code point and a byte is the part that trips people up. For ASCII characters the two are identical, which is why the tool is safe and intuitive on English text. Outside that range they diverge: a Chinese character has one code point but three UTF-8 bytes, so this output and the hex output show different numbers for the same text.

That makes this tool most useful for the ASCII range specifically — working out why a comparison failed because a character is a non-breaking space rather than a space, checking that a control character is really a tab and not four spaces, or producing character codes for a test case.

One number is reported per character and there is no second column to cross-check against, so the page will not show the hexadecimal form, the UTF-8 bytes or the character name alongside the decimal value — those come from separate tools. Neither case variant is produced: the output is decimal only, and nothing is upper- or lower-cased on the way through. The original text is not echoed back next to the codes, which makes it harder to line a code up with the character it came from when a passage contains repeated symbols; paste the source alongside the result if you need that alignment. There is also no filtering, so every character in the input produces a number including spaces and line breaks.

How to use Text to ASCII

  1. 1 Type or paste the text whose character codes you want.
  2. 2 Each character is shown as its decimal character code, separated by spaces, and updates live.
  3. 3 Copy the codes for use in test data, documentation or a character-range check.

Frequently asked questions

What is the difference between a code point and a byte?

A code point is the character's number in Unicode; a byte is how it is stored. They match for ASCII, so A is 65 either way. For characters outside ASCII they differ — a code point above 127 needs two or more bytes in UTF-8.

Why do Chinese characters show a single number here but three numbers in the hex output?

Because the two tools report different things. This one gives the Unicode code point, of which there is exactly one per character. The hex output gives the UTF-8 bytes, of which there are three. Both are correct descriptions of the same character.

How can I tell a tab from spaces using this?

A tab is code 9, while a space is 32. If you expected one tab and see four 32s, the file contains spaces instead. That distinction is invisible on screen but explains a great many alignment and parsing failures.

Why is 160 appearing where I expected a space?

Code 160 is a non-breaking space — it looks like a space but is a different character, so it fails equality checks against a normal space and is not removed by trimming. Seeing 160 in the output identifies the cause.

Free, online, and private

Free to use

Text to ASCII is completely free. There is no account to create, no login, and no hidden charge or usage limit.

Runs online in your browser

It is a free online tool that runs entirely in your browser. Nothing to download or install — open the page and start using it right away.

Your data stays private

All processing happens locally on your device. Your input is never uploaded, stored, or tracked, so it never leaves your browser.

How Text to ASCII behaves in detail

These are the specifics of this implementation — the exact ranges, defaults and fixed settings you are working with.

Parameter Value
Counting unit UTF-16 code units read with charCodeAt(0), not bytes
Output base decimal numbers joined by single spaces
Multibyte example a CJK character gives one number (20320), not the three bytes UTF-8 would need
ASCII example A is 65 and a is 97; no padding or column alignment is applied
Astral characters collapse to the first code unit — an emoji emits 55357 and loses its lower half

Compiled from the implementation of this tool and checked against it by itoolnet.

What Text to ASCII does not do

Knowing the edges of a tool saves more time than another list of its features. These are the cases where it will not do what you might expect.

  • This is a code-unit view rather than a byte view. One CJK character becomes a single number such as 20320, so the output cannot be handed to a byte decoder — Binary to Text would expect 8-bit groups and misread every value above 255.
  • The character loop yields whole code points while charCodeAt reads only the first UTF-16 unit, so a supplementary character is truncated to its high surrogate. The number printed does not convert back to the character it came from.
  • Separators are single spaces with no choice of commas, newlines or fixed-width columns, so long output is a single run of numbers that is awkward to line up in a spreadsheet or diff against a second encoding.

Tested and documented by itoolnet, the team that builds and maintains this site.

Share & embed this tool

Writing a guide or article? You are welcome to link to Text to ASCII with the snippet below. It is free, runs entirely in your browser, and needs no signup.