atbashcipher.com

Cipher Tutorials8 min read

Hexadecimal Explained: How to Convert Hex to Text

By Jack Shi, Founder & Lead WriterView Jack Shi on LinkedIn

To convert hexadecimal to text, split the hex into two-digit pairs, turn each pair into a decimal number from 0 to 255, then look up that number as an ASCII character. For example 48 65 6C 6C 6F becomes Hello. You can do it instantly with the hex encoder / decoder, but the three steps below let you do it by hand and understand exactly what each byte means.

TL;DR

  • Hexadecimal is base 16: digits 0-9 then A-F for the values 10-15.
  • Each pair of hex digits is one byte = one number from 0 to 255 = (usually) one character.
  • Three steps: pair up the digits → hex to decimaldecimal to ASCII.
  • 48 65 6C 6C 6F 20 57 6F 72 6C 64 = Hello World.
  • Plain ASCII is one byte per character; accented letters and emoji are UTF-8 and use two to four bytes.

What Is Hexadecimal?

Hexadecimal (“hex”) is a base-16 number system. Where decimal uses ten digits (0-9), hex uses sixteen: 0 1 2 3 4 5 6 7 8 9 A B C D E F, where A=10, B=11, up to F=15. It is popular in computing because one hex digit represents exactly four bits, so a single byte (eight bits) is always written as exactly two hex digits — from 00 (0) to FF (255). That tidy two-digit-per-byte mapping is what makes hex a compact way to write the raw bytes behind text, colors, or memory.

Step 1 — Split the Hex Into Byte Pairs

Text stored as hex is a run of bytes, and each byte is two hex digits. So the first move is always to group the string two digits at a time. Spaces (or separators like :) are just there for readability — remove them first, then re-pair:

48656C6C6F48 · 65 · 6C · 6C · 6F

If your string has an odd number of digits after removing separators, something is wrong — a byte is missing a digit. Some sources also prefix hex with 0x (as in 0x48); strip the 0x before pairing.

Step 2 — Convert Each Pair From Hex to Decimal

A two-digit hex byte has a “sixteens” place and a “ones” place, exactly like decimal has tens and ones. Multiply the first digit by 16 and add the second digit:

HexCalculationDecimal
484×16 + 872
656×16 + 5101
6C6×16 + 12108
6F6×16 + 15111
202×16 + 032

Remember that the letter digits are values: A=10, B=11, C=12, D=13, E=14, F=15. So in 6C, the C is 12, giving 6×16 + 12 = 108.

Step 3 — Map Each Number to Its ASCII Character

Now read each decimal number as a character using ASCII, the standard that assigns numbers 0-127 to letters, digits, and symbols (32 is a space, 65 is A, 97 is a). Our five bytes become:

72 → H, 101 → e, 108 → l, 108 → l, 111 → o = Hello.

Extend the same run and 48 65 6C 6C 6F 20 57 6F 72 6C 64 decodes to Hello World — note 20 is the space between the two words.

Hex → Decimal → Character Lookup Table

A few common characters, so you can spot-check any conversion by eye:

CharacterDecimalHex
(space)3220
!3321
?633F
04830
95739
A6541
H7248
a9761
h10468

Two patterns fall out of this: uppercase letters start at 41 (A) and lowercase at 61 (a), so any lowercase letter is exactly 20 (32) higher than its uppercase form. Digits 0-9 sit at 30-39, which is why hex dumps of numbers look so regular.

The Reverse: Text to Hex

Going the other way, take each character’s ASCII number and write it as two hex digits. Hi! is H=72, i=105, !=33, which in hex is 48 69 21. To convert a decimal number to hex by hand, divide by 16: the quotient is the first digit and the remainder is the second (105 ÷ 16 = 6 remainder 9, so 69).

Formats and Pitfalls

  • Case doesn’t matter for the value: 6c and 6C are the same byte (108). Uppercase is just a convention.
  • Separators are cosmetic: 48 65, 4865, and 48:65 all decode the same — strip spaces and colons before pairing.
  • The 0x prefix marks a value as hex in code (0x48); it is not part of the byte, so remove it.
  • Non-ASCII text is UTF-8: characters beyond plain ASCII take more than one byte. The letter é is the two bytes C3 A9, and most emoji are four bytes. Decode byte-by-byte as ASCII and you will get garbled symbols — you need a UTF-8-aware decoder for those.
  • Odd digit count = error: valid hex text always has an even number of digits once separators are removed.

FAQ

How do I convert hex to text?

Split the hex into two-digit pairs, convert each pair to a decimal number (first digit × 16 + second digit), then read that number as an ASCII character. For instance 48 65 6C 6C 6F is 72, 101, 108, 108, 111 = Hello.

What does each pair of hex digits mean?

Each pair is one byte, a value from 0 to 255. In plain ASCII text, one byte is one character; in UTF-8, accented letters and emoji span two to four bytes.

Why does hex use letters A to F?

Hex is base 16, so it needs sixteen digit symbols. After 0-9 it borrows A-F to represent the values 10 through 15, which keeps every byte to exactly two characters (00-FF).

Does uppercase or lowercase hex matter?

No. 6C and 6c represent the same value (108). Case and separators like spaces or colons are only for readability.

Why did my hex decode to gibberish?

Usually the text was UTF-8 rather than plain ASCII, so multi-byte characters were split, or separators/an 0x prefix threw off the pairing. Remove prefixes and separators, check for an even digit count, and use a UTF-8-aware decoder for non-English text.

Hex isn’t a code to crack — it is just base 16 wearing a disguise. Once you see each pair as “a number from 0 to 255,” converting hex to text is only two small lookups per byte.

— Jack Shi, Cryptography Researcher

Convert any string instantly with the hex encoder / decoder, switch between bases with the binary ↔ hex converter, inspect character codes in the ASCII converter, or read the companion guide on converting binary to text. Browse every encoder in the tools list.

hex to texthexadecimalhex to asciiconvert hextext to hexascii

Jack Shi

Founder & Lead Writer, Atbash Cipher Tool

Jack Shi builds and maintains free online cryptography, encoding, and text-transformation tools, and writes practical guides on ciphers, encoding, and hashing.

View Jack Shi on LinkedIn →

Related Articles