Hex ↔ Text Converter

How do I convert text to hex?

How it is calculated

In encode mode the tool takes your text as bytes and writes each byte as two hexadecimal digits (00 to ff), separated by spaces. It works on the raw bytes of the text, so a plain ASCII letter is one byte, while accented letters, symbols and emoji are written as several bytes (UTF-8 encoding). In decode mode it removes all whitespace from your input, reads the remaining hex digits in pairs and turns them back into characters; if the string contains a non-hex character or an odd number of digits, it reports it as invalid. Output letters are lowercase. This is an encoding, not encryption: anyone can reverse it.

Worked example

Encode the word Hello. Its characters have the byte values 72, 101, 108, 108, 111 in decimal. In hex these are 48, 65, 6c, 6c, 6f (for example 72 = 4×16 + 8 = 48). Joined with spaces, the result is 48 65 6c 6c 6f. Switching to decode and pasting that string returns Hello.

Try this example →

Common mistakes

  • Pasting a hex string with an odd number of digits or a stray character such as a 0x prefix or a comma, which makes decoding fail.
  • Expecting one pair per character: non-English letters and emoji take two to four bytes in UTF-8.
  • Treating hex as a secret code; it hides nothing.
  • Confusing hex with decimal byte values or with Base64, which are different encodings.
  • Forgetting that uppercase and lowercase letters have different codes (H is 48, h is 68).

About this calculator

This tool converts text into a hexadecimal byte string, where each character's underlying numeric code is written as a two-digit base-16 value, or decodes a hex string back into readable text. Hexadecimal is used because two hex digits map cleanly onto one byte, making it a far more compact and readable way to represent raw byte data than writing out the equivalent binary.

Developers use hex-text conversion constantly when debugging network traffic, inspecting the raw bytes of a file, working with color codes, memory dumps, or low-level protocol data, since many debugging tools and logs display data in hex rather than plain text. It is also common in puzzle-solving and CTF challenges where a message has been hidden as a hex string, and in cryptography-adjacent work where converting between text and its hex representation is a routine intermediate step.

Was this helpful?

You can pick up to 3 reactions.

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators