ASCII and Character Code Converter

Convert text to decimal, hexadecimal, binary and octal character codes, or decimal codes back to text. Computers store text as numbers. Example: with direction Text to character codes, text, or decimal codes separated by spaces Hi!, the result is Decimal = 72 105 33; Hexadecimal = 48 69 21.

Last updated · By · Runs in your browser, nothing is uploaded

Result

Step-by-Step Solution

Enter your values above to see the full working.

How do you use the ASCII and Character Code Converter?

Choose a direction. To convert text to codes, type any text, up to 200 characters, and the converter shows each character’s code in decimal, hexadecimal, binary and octal. To go the other way, switch to decimal codes to text and enter numbers separated by spaces or commas, such as 72 105 33, to see the text they spell.

The Step-by-Step Solution lists each character with its code in every base, which is handy when learning how characters are stored or when checking a table by hand.

What formula does the ASCII and Character Code Converter use?

Computers store text as numbers. ASCII, the American Standard Code for Information Interchange, assigns codes 0 to 127 to the English letters, digits, punctuation and control characters. Uppercase A is 65, lowercase a is 97, the digit 0 is 48 and a space is 32. Unicode extends the same idea to more than a million code points covering every writing system and emoji, and its first 128 values are identical to ASCII.

Each code can be written in any base. Hex is the favourite for programmers: the letter H is 72 in decimal, 48 in hex and 01001000 in binary. This converter uses the Unicode code point of each character, shown in 8 binary digits for codes up to 255 and in 16 for larger ones.

Worked example: Hi!

The letter H is 72, i is 105 and the exclamation mark is 33. In hexadecimal that is 48, 69 and 21, in octal 110, 151 and 41, and in binary 01001000, 01101001 and 00100001. Converting the decimal codes 72 105 33 back gives the original text. A handy pattern to remember is that each lowercase letter’s code is its uppercase code plus 32, which in binary is the single bit at the 32 position, so toggling that bit changes the case.

Where character codes are useful

Programmers use character codes to compare and sort text, to build simple ciphers, to check for digits and letters by range and to debug unexpected characters in data. Network and file formats often show data as hex bytes, so recognising that 41 is A and 0A is a line feed helps when reading dumps. Students meet ASCII in the first weeks of any computing course.

One caution: the code point of a character is not always the same as the bytes used to store it. In the common UTF-8 encoding, characters outside ASCII take more than one byte. The letter é has the code point 233, written E9 in hex, but is stored in UTF-8 as the two bytes C3 A9. This tool reports code points, not encoded bytes.

What are the most common mistakes with the ASCII and Character Code Converter?

  • Confusing a digit character with its numeric value. The character 5 has code 53, not 5.
  • Assuming ASCII covers accented letters or symbols. It stops at 127.
  • Mixing up code points with the bytes of an encoding such as UTF-8.
  • Forgetting invisible characters like spaces, tabs and line feeds, which have codes of their own.

What Is the Tested Example for the Default Values?

This example is computed by the same code that powers the calculator above, so you can compare it with your own numbers or a textbook answer.

Input: DirectionText to character codes
Input: Text, or decimal codes separated by spacesHi!
Decimal72 105 33
Hexadecimal48 69 21
Binary01001000 01101001 00100001
Octal110 151 41
Characters3

Where Can You Verify These Formulas?

The definitions and formulas on this page follow standard references. Check them against these sources:

Built and maintained by S. Dilshan. Found a mistake? Email [email protected] with the page address.

Frequently Asked Questions

What is the ASCII code for the letter A?

Uppercase A is 65 in decimal, 41 in hexadecimal and 01000001 in binary. Lowercase a is 97.

What is the difference between ASCII and Unicode?

ASCII has 128 characters. Unicode covers over a million, and its first 128 code points match ASCII.

Why do uppercase and lowercase letters differ by 32?

The codes were designed so a single bit, worth 32, distinguishes the cases, making case conversion a simple bit change.