Home › Math & Science › Hex to ASCII Converter

Hex to ASCII Converter

Use this free hex to ASCII converter to turn hexadecimal bytes into readable text, or flip it around and convert text back into hex. It accepts hex with or without a 0x prefix, ignores spaces between bytes, and shows the decimal and binary value of the first byte as a bonus. Everything runs in your browser, so nothing you paste is sent anywhere.

Paste hex like 48656C6C6F, 48 65 6C 6C 6F, or 0x48656C6C6F. Only 0–9 and A–F are valid hex digits.

Hello
5 bytes converted.

How it works

Computers store text as numbers. ASCII, the American Standard Code for Information Interchange, assigns a number from 0 to 127 to each letter, digit, and punctuation mark. The letter A is 65, a lowercase a is 97, and a space is 32. Hexadecimal is just a compact way to write those numbers: base 16 instead of base 10, using the digits 0–9 plus the letters A–F for the values 10–15. Because 16 squared is 256, exactly two hex digits hold one byte, which is exactly one ASCII character.

Hex pair → decimal value → ASCII character  |  e.g. 48₁₆ = 72₁₀ = "H"

To convert hex to text, split the string into pairs. Each pair is one byte: multiply the first digit by 16 and add the second. The pair 48 becomes 4 × 16 + 8 = 72, and 72 in the ASCII table is the letter H. The pair 65 becomes 6 × 16 + 5 = 101, which is the letter e. Keep going pair by pair until the whole string is decoded. The converter also shows the decimal and binary value of the first byte, so you can see all three ways of writing the same number at a glance.

Valid hex is strict about what it accepts. Only the characters 0–9 and A–F count, in upper or lower case, and the cleaned-up string must have an even length, because every byte needs exactly two digits. Spaces between byte pairs are fine — 48 65 6C 6C 6F means the same as 48656C6C6F — and a leading 0x is fine too, since programmers use it to mark a number as hexadecimal. Anything else, like the letter G or an odd trailing digit, stops the conversion, and the converter tells you exactly which character or rule failed instead of guessing.

The reverse direction works the same way in reverse. Each character of your text has an ASCII number, and the converter writes that number as two hex digits. The word Hello is H = 72 = 48, e = 101 = 65, l = 108 = 6C, l = 108 = 6C, o = 111 = 6F, giving 48656C6C6F. Turn on the 0x toggle and the output becomes 0x48656C6C6F instead, which is the format most programming languages expect. The case toggle switches between uppercase hex (48656C6C6F) and lowercase (48656c6c6f); both mean exactly the same thing.

Worked example

Decode the hex string 48656C6C6F and check it against the converter.

Step 1: Split into byte pairs — 48, 65, 6C, 6C, 6F.
Step 2: Convert each pair to decimal — 48 = 4 × 16 + 8 = 72; 65 = 6 × 16 + 5 = 101; 6C = 6 × 16 + 12 = 108; 6C = 108; 6F = 6 × 16 + 15 = 111.
Step 3: Look each number up in the ASCII table — 72 = H, 101 = e, 108 = l, 108 = l, 111 = o.
Step 4: Join the characters — "Hello".

Paste 48656C6C6F into the converter and it gives exactly the same result: "Hello", 5 bytes converted, and the first byte shown as decimal 72 and binary 01001000. Going the other way, typing "Hello" in Text to Hex mode produces 48656C6C6F.

FAQ

How do I convert hex to ASCII text?

Split the hex into pairs of digits, and each pair is one byte. Convert each byte from hexadecimal to decimal, then look up that number in the ASCII table to get the character. For example, 48 in hex is 72 in decimal, which is the letter H. Paste your hex into the converter and it does all the pairs at once.

Why does my hex string need an even number of digits?

One ASCII character is one byte, and one byte is exactly two hex digits. An odd-length string leaves a half byte with no partner, so the converter cannot tell which character it is. Add a leading zero, for example turn 48656C6C6F into the same string with a 0 in front of a lone digit, or remove the stray character.

What characters can appear in a hex string?

Only the digits 0 to 9 and the letters A to F, in upper or lower case. The letters G through Z are not hex digits, and neither are symbols like @ or #. The converter checks every character and points out the first one it does not recognize.

What does the 0x prefix mean in hex?

The 0x prefix is a marker used in programming to say the number that follows is hexadecimal, not decimal. So 0x48 and 48 mean the same thing in a hex context. The converter accepts 0x at the start of the input and can also add it to the hex it produces, if you turn the prefix toggle on.

How do I convert ASCII text back to hex?

Take each character, find its number in the ASCII table, and write that number in hexadecimal with two digits. The letter H is 72 in decimal, which is 48 in hex, so the word Hello becomes 48656C6C6F. Switch the converter to Text to Hex mode and it does the whole string for you.