Skip to content
AgileLogics

ASCII to Decimal

Converts each character of your text into its decimal ASCII code or, beyond ASCII, its Unicode code point (é is 233), space-separated.

How it works

Type or paste text into the input panel and click Convert.

What does ASCII to decimal conversion give you?

ASCII to decimal conversion replaces every character in a piece of text with the number a computer uses for it, written in ordinary base 10. A becomes 65, a becomes 97 and a space becomes 32. This converter outputs one number per character, separated by spaces, and for characters outside ASCII it gives the Unicode code point instead.

ASCII itself is a 7-bit code, the version adopted for network use is written up in RFC 20, and 7 bits allow exactly 128 codes, 0 to 127. Unicode kept those first 128 assignments unchanged, which is why the numbers here match whichever standard you look them up in.

Converting a short string

  1. Type or paste your text in the input box.
  2. Click Convert.
  3. Copy the space-separated list of decimal codes.

Take the input Code 7. The output is 67 111 100 101 32 55. Read it character by character: C is 67, o is 111, d is 100, e is 101, the space is 32 and the digit 7 is 55. Notice that the digit seven doesn't become 7. Digits are characters like any other, and their codes start at 48.

How the 128 codes are laid out

The ASCII table wasn't filled in at random. Related characters sit in contiguous runs, and once you know the starting points you can read most codes without a chart:

Decimal range Contents Example
0 to 31 Control codes (tab, line feed, carriage return, escape) 9 is tab, 10 is line feed
32 Space
33 to 47 Punctuation and symbols 33 is !, 47 is /
48 to 57 Digits 0 to 9 55 is 7
58 to 64 More punctuation 64 is @
65 to 90 Uppercase A to Z 67 is C
91 to 96 Brackets, backslash, caret, underscore, backtick 95 is _
97 to 122 Lowercase a to z 111 is o
123 to 126 Braces, pipe, tilde 123 is {
127 Delete (DEL), a control code

For the full list with every symbol, the ASCII table lists all 128 entries with their decimal and hex codes next to each character or control-code name. You can also search it: a plain number like 65 finds that decimal code, 0x41 finds a hex code, a single character finds itself, and names such as null or newline find the matching control code.

Arithmetic the layout makes possible

Because of that ordering, a few calculations come up constantly in code:

  • Digit value. Subtract 48 from a digit's code and you have its numeric value. 7 is 55, and 55 minus 48 is 7. This is how hand-written number parsers turn characters into numbers.
  • Changing case. Add 32 to an uppercase letter's code to get the lowercase letter, or subtract 32 to go the other way. C (67) plus 32 is 99, which is c.
  • Alphabet position. Subtract 64 from an uppercase letter, or 96 from a lowercase one, to get its position in the alphabet. E is 69, so it's the fifth letter.

The ordering also explains a sorting quirk. A plain code-by-code sort puts every uppercase letter before every lowercase one, because 90 (Z) is smaller than 97 (a). Convert Zebra apple and you get 90 101 98 114 97 32 97 112 112 108 101: the 90 at the start is why "Zebra" sorts ahead of "apple" in a case-sensitive sort. Sorting tools that ignore case compare letters after folding them to one case first.

What happens above 127

Strictly speaking, ASCII has nothing to say about é or €. Rather than failing, this tool reads each character's Unicode code point, the same number JavaScript's codePointAt returns, and prints it in decimal:

Character Output Note
é 233 Same as its Latin-1 value
€ 8364 U+20AC
👍 128077 One number, even though it's outside the Basic Multilingual Plane

So café becomes 99 97 102 233, four numbers for four characters. These are code points, not bytes. If you need the UTF-8 bytes that a file actually stores, where é is two bytes, use text to hex instead.

A quick way to check whether text is plain ASCII is to convert it and look for any number over 127. If there isn't one, every character is in the original 128-code set.

When decimal codes are the right format

Decimal is the format most programming languages print by default. Python's ord('A') returns 65, and JavaScript's 'A'.charCodeAt(0) does the same, so decimal codes are what you compare against when debugging string handling. They also turn up in HTML numeric references such as A, in spreadsheet functions like CODE() and CHAR(), and in classroom exercises on character encoding. Hex is more common in byte dumps and network traces; for that, see ASCII to hex.

To turn a list of codes back into readable text, paste it into decimal to ASCII.

Last updated

Frequently asked questions

What decimal code does each letter have in ASCII?
Uppercase A to Z are 65 to 90, lowercase a to z are 97 to 122, and the digits 0 to 9 are 48 to 57. A space is 32. Every lowercase letter is exactly 32 more than its uppercase partner, so A is 65 and a is 97.
Why do some characters give numbers bigger than 127?
ASCII only defines codes 0 to 127. For anything else the tool outputs the character's Unicode code point in decimal, so é is 233, the euro sign is 8364 and the thumbs-up emoji is 128077. Each character still gets exactly one number.
How are the numbers separated?
With a single space, one number per character, including spaces and line breaks in your text. A space shows up as 32 and a line break as 10.
Can I convert the decimal codes back to text?
Yes. Paste the space-separated numbers into the Decimal to ASCII converter and you get the original text back.
Is my text uploaded?
No. The conversion runs in JavaScript in your browser and the page makes no network request with your input.