Text to ASCII Codes
Convert text into its ASCII/Unicode character codes, separated by spaces.
Was this tool helpful?
Thanks for the feedback!
This converter replaces every character of your text with its numeric character code in decimal, separated by spaces, so Hello becomes 72 101 108 108 111. It is handy for learning how computers store text, for debugging strange characters in data, and for preparing values for code that works with character codes.
What the numbers mean
ASCII assigns the numbers 0 to 127 to English letters, digits, punctuation and a set of control characters. A few landmarks make the table easy to remember:
| Characters | Codes |
|---|---|
| Space | 32 |
| Digits 0 to 9 | 48 to 57 |
| Capitals A to Z | 65 to 90 |
| Small letters a to z | 97 to 122 |
| Tab, line break | 9, 10 |
Every small letter is exactly 32 more than its capital, which is why converting case in old programs was a matter of adding or subtracting 32. The digit characters are not their own values: the character "0" is code 48.
Worked example
Input Aa Zz 09 followed by a tab and ! gives:
65 97 32 90 122 32 48 57 9 33
Spaces show up as 32 and the tab as 9, so invisible characters become visible. That is the main debugging use: if a value that looks like "Delhi" fails to match, converting it may reveal a hidden 160 (non-breaking space) or 8203 (zero-width space) that you cannot see on screen.
Characters beyond ASCII
The tool is not limited to ASCII. For anything else it outputs the character's code in JavaScript's UTF-16 encoding, which for most characters equals its Unicode code point:
égives 233,₹gives 8377 (U+20B9) and the Hindi letterनgives 2344.- Emoji and other characters above code point 65535 are split into two numbers called a surrogate pair.
😀gives55357 56832, not its code point 128512. - Hindi syllables are several codes each: a consonant, a vowel sign and sometimes a virama, so a short word can produce five or six numbers.
Keep in mind that these are character codes, not bytes. In UTF-8 the rupee sign takes three bytes, which is a different set of numbers entirely.
Using the output
An empty input shows the message "Enter some text." instead of a result. Output is always decimal and space-separated; there is no option for hexadecimal or comma separators. For hex values use the text to hex converter, and to turn a list of codes back into readable text, paste them into ASCII Codes to Text, which also reassembles emoji surrogate pairs. Students comparing number systems can take the same text through the binary converter to see each code in base 2.