Text to ASCII Code Converter – Free

This text to ASCII converter lists the decimal character code of every character you enter. Codes are separated by spaces and follow the order of the text.

How to use the Text to ASCII tool

  1. Type or paste plain text into the Text box.
  2. Select Convert. The Example button converts the sample ABC to 65 66 67.
  3. Read the decimal ASCII codes in the Result box, one per character.
  4. Select Copy to copy the codes, or Clear to empty the box.

How text maps to ASCII codes

ASCII, standardized as ANSI X3.4 and described for the internet in RFC 20, assigns the numbers 0 to 127 to 128 characters. Codes 32 to 126 are the 95 printable characters: space, digits, the English alphabet in both cases and common punctuation. Codes 0 to 31 and 127 are control characters such as tab, line feed and delete.

The layout has useful patterns. Digits 0 to 9 run from 48 to 57, so a digit's value is its code minus 48. Uppercase letters run from 65 to 90 and lowercase from 97 to 122, exactly 32 apart, which means the two cases of a letter differ in a single bit.

Worked example: converting a short string

Each character becomes one decimal number. Spaces and punctuation are characters too, so they get codes of their own: 44 for the comma and 32 for the space in the second line below.

ABC            →  65 66 67
Hello, World!  →  72 101 108 108 111 44 32 87 111 114 108 100 33
A1 z           →  65 49 32 122

What the Text to ASCII converter accepts

The tool encodes your text and checks that every character falls inside the ASCII range. If any character is outside it, nothing is converted and the message Enter ASCII characters only appears. Typical offenders are accented letters, curly quotes pasted from a word processor, the euro sign and emoji.

  • The text is not trimmed. Leading and trailing spaces each produce a 32.
  • A tab becomes 9 and a line break in the box becomes 10.
  • Codes are written in decimal without padding, so they are one to three digits long.
  • An empty box produces an empty result.

Related conversions

Decimal is only one way to write a character code. On this site, ASCII to Hex and ASCII to Binary print the same codes in base 16 and as 8-bit groups, and ASCII to Text turns a list of codes back into characters. For text that includes characters beyond ASCII, use Text to Binary, which encodes with UTF-8, or Unicode to Hex, which lists code points.

Frequently asked questions

What is the ASCII code for the letter A?

Uppercase A is 65 and lowercase a is 97. The rest of the alphabet follows in order, so B is 66 and Z is 90. Add 32 to an uppercase code to get the lowercase letter.

What is the ASCII code for a space?

A space is 32, the first printable character. It appears in the output like any other code, so the text a b converts to 97 32 98.

Why do I get the message Enter ASCII characters only?

The text contains a character with no ASCII code, such as an accented letter, a typographic quote or an emoji. ASCII stops at 127. Remove or replace the character, or use a Unicode-aware tool.

Are line breaks and tabs converted?

Yes. A line break typed in the Text box is reported as 10, the line feed character, and a tab as 9. They are control characters, so they have codes but no visible glyph.

Are the codes decimal or hexadecimal?

Decimal. Each code is a base-10 number from 0 to 127. If you need hex values such as 41 for A, the ASCII to Hex tool gives the same characters in base 16.

Is ASCII the same as UTF-8?

For these 128 characters, yes. UTF-8 was designed so that every ASCII character is stored as one byte with the same value. The encodings differ only for characters outside ASCII, which UTF-8 stores in two to four bytes.

Related tools