Text Tools

Text to ASCII Converter

Convert text to ASCII/Unicode character codes and back.

Results are provided for general informational use. Verify important financial, health or legal figures before relying on them.

About this Text to ASCII Converter

The Text to ASCII Converter changes each character in a text into its numeric character code, useful for understanding encoding, debugging text issues or simple obfuscation. It can also convert a list of codes back into readable text.

Converting text to its underlying ASCII or Unicode character codes is a useful way to understand exactly how computers represent text internally, and it's genuinely practical for programming tasks like debugging encoding issues.

How the calculation works

Each character's code point is read with the string charCodeAt method and displayed as a decimal number; the reverse direction rebuilds characters with fromCharCode.

How to use it

  1. Paste text, or a space-separated list of character codes.
  2. Select Text to codes or Codes to text.
  3. Copy the converted result.

Practical example

The text “Hi” converts to the codes 72 105, since H is character code 72 and i is character code 105.

The letter A has an ASCII/Unicode code point of 65, while lowercase a is 97, a 32-point difference that holds consistently across the entire alphabet.

Things to double-check

Standard ASCII only covers 128 characters, essentially the basic English alphabet, digits and common punctuation, so any text containing accented letters, emoji or non-Latin scripts requires the broader Unicode character set.

Characters and their codes

Every character is stored as a number. In ASCII, the capital letter A is 65, a is 97, the digit 0 is 48 and the space is 32. The word Hello becomes 72 101 108 108 111. The difference between a capital and its lowercase letter is always 32. The tool converts text to these codes and back, which helps in programming, teaching and debugging.

Beyond ASCII

ASCII covers only 128 characters. Unicode extends this to well over a hundred thousand characters, and the number for each is called a code point. The letter é is 233, the euro sign is 8364 and the grinning face emoji is 128512. Codes above 127 are not ASCII, though the tool shows the Unicode value. Text files store these numbers as bytes in an encoding such as UTF-8, where one character can use several bytes.

Control characters

Codes 0 to 31 are control characters, not printable symbols. Code 10 is the line feed that ends a line on Linux and macOS, and 13 is the carriage return, used with 10 on Windows. Code 9 is the tab. When a file behaves strangely, converting a small piece to codes can reveal hidden characters such as a stray tab or a non-breaking space, which is code 160.

Where it helps

Developers use code conversion to debug encoding problems, check input validation and understand how characters are compared when sorting. Students use it to learn how computers store text. If you get strange symbols when you open a file, the cause is often a mismatch between the encoding used to save and the one used to read, and checking the numbers can show which characters are affected.

Reading codes from a log

When you meet a list of numbers in a log or a message, you can decode it. The numbers 72 101 108 108 111 spell Hello. The same word in hexadecimal is 48 65 6C 6C 6F, and the letter H alone is 01001000 in binary, since 72 is 64 plus 8. Knowing these representations helps when you debug serial data, network traffic and file formats. If a number above 127 appears, the text is using Unicode, and the encoding of the file decides how many bytes it takes.

Worked example: the word Dekuz

The letters of Dekuz are D, e, k, u and z. Their ASCII codes are 68, 101, 107, 117 and 122. In hexadecimal, these are 44, 65, 6B, 75 and 7A, and in binary the first letter is 01000100. Capital and lowercase letters differ by 32, so d is 100 and D is 68. The tool shows the codes for any text you enter and can convert a list of codes back into text, which is handy when you decode a message or check what a file really contains.

The ASCII table in brief

The printable characters start at 32, the space. The digits 0 to 9 are 48 to 57, the capital letters A to Z are 65 to 90 and the lowercase letters a to z are 97 to 122. Codes 0 to 31 and 127 are control characters: 9 is the tab, 10 is the line feed that ends a line on Linux and macOS, and 13 is the carriage return that is paired with 10 on Windows. Knowing these ranges lets you read raw data and spot problems, such as a stray control character in a text file.

Beyond ASCII: Unicode and UTF-8

Unicode gives a number, called a code point, to characters from all the world's writing systems. The letter e with an acute accent is 233, the Urdu letter alef is 1575 and the grinning face emoji is 128512. When text is saved, an encoding such as UTF-8 converts each code point to one to four bytes. The Urdu alef takes two bytes, D8 and A7, and the emoji takes four. The tool shows code points, so a number above 127 means that the character is outside plain ASCII, and the byte count depends on the encoding.

Practical uses

Converting text to codes helps when you debug garbled text, sometimes called mojibake, which happens when a file saved in one encoding is read as another. It also helps check input validation, understand how sorting works, and learn how computers store text. Simple ciphers such as the Caesar cipher can be written as arithmetic on codes. Barcodes and some communication protocols use character codes directly. If something looks strange, convert a few characters to codes and compare them with what you expected.

Key terms explained

ASCII is a character set that assigns numbers from 0 to 127 to letters, digits, punctuation and control codes. Unicode assigns numbers, called code points, to characters from all writing systems. UTF-8 is an encoding that stores code points in one to four bytes. A control character is a non-printing code such as a tab or line feed. Hexadecimal and binary are other ways of writing the numbers. Mojibake is garbled text caused by reading data in the wrong encoding.

Rules of thumb and quick checks

Capital A is 65, lowercase a is 97, zero is 48 and space is 32. The difference between a capital and its lowercase letter is 32. Codes above 127 are not ASCII. A line feed is 10, a carriage return 13 and a tab 9. If you see strange symbols in a file, convert a few characters to codes and compare with what you expect, then check the encoding used to save and open the file.

Frequently asked questions

Does this handle Unicode characters beyond basic ASCII?

Yes, the underlying character codes work for the full Unicode range, not only the original 128-character ASCII set.

What separates the codes?

Codes are separated by single spaces.

Can I convert emoji or accented letters?

Yes, though some characters outside the basic plane may be represented as a pair of codes.

What is the difference between ASCII and Unicode?

ASCII is a smaller, older character set covering just 128 basic characters, while Unicode is a much larger standard designed to represent virtually every character from every written language.

Why is there exactly a difference of 32 between uppercase and lowercase letter codes?

This offset was a deliberate design choice in the original ASCII standard, chosen so that toggling a single bit could convert between the uppercase and lowercase version of the same letter.

Keep exploring

More Text Tools

View category →