๐ค Text to ASCII Code Converter (Decimal)
By Shihab Mia ยท Updated 2026-07-18
Every character, including spaces and punctuation, becomes its ASCII decimal code.
| Character | ASCII (decimal) | Hex | Binary |
|---|
This text to ASCII converter turns any text you type into its ASCII decimal codes in one step, so Hi becomes 72 105 and A becomes 65. Each character is mapped to the number a computer stores for it, and you can join the codes with a space, a comma, or a new line to match whatever format you need. It also reports the character count and shows the hex and binary equivalents, and everything runs in your browser so nothing is uploaded.
What is the Text to ASCII Code Converter?
ASCII, short for the American Standard Code for Information Interchange, is a character encoding that assigns a whole number from 0 to 127 to every letter, digit, punctuation mark, and control code. When you type the letter H, the computer does not store the shape of the letter, it stores the number 72. Converting text to ASCII is simply the job of reading each character in turn and writing down the code that stands for it, so the word Hi turns into the two numbers 72 and 105.
To convert text to ASCII by hand you look each character up in an ASCII table. Capital letters A to Z run from 65 to 90, lowercase letters a to z run from 97 to 122, and the digits 0 to 9 run from 48 to 57. Notice that lowercase letters sit exactly 32 higher than their capital versions, so a is 97 while A is 65. The space character is 32, and common punctuation like the exclamation mark is 33 and the comma is 44. Reading Hi character by character gives H as 72 and i as 105, which is the result you see above.
In code this lookup is done for you. In JavaScript the method charCodeAt returns the ASCII code of a character, so the string Hi produces 72 then 105. Higher level text often uses Unicode, which extends the idea far beyond 127 to cover every writing system and emoji, but for the first 128 code points Unicode and ASCII agree exactly, so plain English text gives identical results either way. This tool reads full Unicode code points, so if you paste a character above 127, such as an accented letter or an emoji, you still get its correct numeric code, and the tool flags how many of those non-ASCII characters are present.
The reverse operation, turning codes like 72 105 back into Hi, is called ASCII to text decoding. Together the two directions let you move freely between human readable text and the raw numbers that computers, networks, and file formats actually move around. Because ASCII decimal is compact and unambiguous, it is a handy intermediate format for debugging, teaching how text is stored, or preparing data for a system that expects numeric input.
When to use it
- Turning a word or phrase into ASCII decimal codes for a programming exercise, a puzzle, or a homework question.
- Debugging text data by seeing the exact code of every character, including hidden spaces, tabs, and control characters.
- Teaching or learning how computers store letters as numbers, with a live table that updates as you type.
- Preparing a comma or newline separated list of character codes to paste into a script, spreadsheet, or hardware tool.
How to use the Text to ASCII Code Converter
- Type or paste your text into the box, or pick one of the ready made examples.
- Choose how the codes should be joined: a space, a comma, or a new line.
- Read the ASCII codes at the top and check the character count and per character table below.
- Press Copy to grab the full list of codes for use in your own code or document.
Formula & method
Worked examples
Convert the text Hi to ASCII decimal codes.
- Read the first character: H.
- Look up H in the ASCII table: it is code 72.
- Read the second character: i.
- Look up i in the ASCII table: it is code 105.
- Join the two codes with a space.
Result: Hi in ASCII is 72 105, and the character count is 2.
Convert Hi! using a comma separator.
- H is 72 and i is 105, as before.
- The exclamation mark is the next character.
- Look up ! in the ASCII table: it is code 33.
- Join all three codes with a comma and a space.
Result: Hi! in ASCII with commas is 72, 105, 33, and the character count is 3.
ASCII codes for common characters in decimal, hex, and binary
| Character | Decimal | Hex | Binary |
|---|---|---|---|
| space | 32 | 20 | 00100000 |
| ! (exclamation) | 33 | 21 | 00100001 |
| , (comma) | 44 | 2C | 00101100 |
| 0 (digit zero) | 48 | 30 | 00110000 |
| 9 (digit nine) | 57 | 39 | 00111001 |
| A | 65 | 41 | 01000001 |
| H | 72 | 48 | 01001000 |
| Z | 90 | 5A | 01011010 |
| a | 97 | 61 | 01100001 |
| i | 105 | 69 | 01101001 |
| z | 122 | 7A | 01111010 |
ASCII code ranges for each group of characters
| Group | Decimal range | Example |
|---|---|---|
| Control codes | 0 to 31 | newline is 10 |
| Space and punctuation | 32 to 47 | space is 32 |
| Digits 0 to 9 | 48 to 57 | 5 is 53 |
| More punctuation | 58 to 64 | : is 58 |
| Uppercase A to Z | 65 to 90 | A is 65 |
| More punctuation | 91 to 96 | _ is 95 |
| Lowercase a to z | 97 to 122 | a is 97 |
| More punctuation and DEL | 123 to 127 | DEL is 127 |
Common mistakes to avoid
- Confusing the digit 0 with the letter O. The digit 0 has ASCII code 48, while the capital letter O has code 79. They look similar but produce very different numbers, so check which one your text actually contains.
- Forgetting that spaces and punctuation have codes too. A space is a real character with code 32, and every comma, period, or symbol has its own code. If your character count seems too high, remember the invisible characters are being counted, which is usually correct.
- Mixing up uppercase and lowercase codes. Uppercase A is 65 but lowercase a is 97, a difference of exactly 32. ASCII is case sensitive, so H and h give different codes, 72 and 104.
- Expecting a code above 127 to be plain ASCII. Standard ASCII only defines codes 0 to 127. Accented letters, curly quotes, and emoji sit above that range and are Unicode, not ASCII. This tool still shows their code point and flags them as non-ASCII.
Glossary
- ASCII
- The American Standard Code for Information Interchange, a character encoding that maps letters, digits, and symbols to the numbers 0 through 127.
- ASCII code
- The whole number, from 0 to 127, that ASCII assigns to a particular character. For example H is 72.
- Character
- A single letter, digit, space, punctuation mark, or control symbol in a piece of text.
- Code point
- The numeric value a character encoding assigns to a character. For the first 128 characters, the Unicode code point and the ASCII code are the same.
- Control character
- An ASCII code from 0 to 31, plus 127, that represents an action such as a new line (10) or a tab (9) rather than a printable symbol.
- Unicode
- A superset of ASCII that assigns code points to characters from every writing system, keeping the same values as ASCII for the first 128 characters.
Frequently asked questions
How do you convert text to ASCII?
To convert text to ASCII, replace each character with its ASCII code, the number a computer uses to store it. Read the text one character at a time and look up each code, so Hi becomes 72 105.
What is the ASCII code for Hi?
The text Hi has the ASCII codes 72 and 105. The capital H is 72 and the lowercase i is 105, giving 72 105 when the codes are joined by a space.
What is the ASCII code for A?
The capital letter A has ASCII code 65. The uppercase letters A to Z run in order from 65 to 90, so B is 66, C is 67, and so on.
Do spaces and punctuation have ASCII codes?
Yes. A space is code 32, a comma is 44, and an exclamation mark is 33. Every character, printable or not, has its own ASCII code, which is why they are all counted here.
What is the difference between ASCII and Unicode?
ASCII covers only 128 characters (codes 0 to 127), while Unicode covers every writing system and emoji. For plain English text the two agree exactly, so this tool gives the same numbers for standard characters.
Can I choose commas instead of spaces between the codes?
Yes. Use the separator dropdown to join the ASCII codes with a space, a comma, or a new line, then copy the result in whichever format your project needs.