Skip to content

Hex to Text Converter (Hex to ASCII)

Convert hex to readable text. Paste hex bytes, with or without spaces or 0x prefixes, and this hex to ASCII converter decodes them into a string.

Runs in your browser Free, no sign-up
Loading tool workspace...

What is Hex to Text Converter?

This hex to text converter, or hex decoder, turns hexadecimal bytes into a readable ASCII string. Each pair of hex digits is one byte, and each byte is an ASCII character code: 48 is H, 65 is e and 6C is l, so 48 65 6C 6C 6F reads "Hello".

Hex-encoded text turns up in packet captures, memory dumps, database blobs, URL and log encodings and capture-the-flag challenges. Paste the hex with or without spaces, such as 48656C6C6F, and the decoded text appears instantly.

How to use Hex to Text Converter

  1. Paste the hex bytes, separated by spaces or as one continuous string; 0x prefixes are fine.
  2. Read the decoded text.
  3. If the result looks wrong, check that every byte has two hex digits.
  4. Copy the text, or click Swap to convert text to hex.

Key features

  • Decodes hex bytes to ASCII text
  • Accepts spaced, comma-separated or continuous hex
  • Accepts 0x prefixes and upper or lower case
  • Swap button to encode text as hex
  • Clear errors for invalid hex characters
  • Runs entirely in your browser

Common use cases

  • Reading text in Wireshark packet captures and hex dumps
  • Decoding hex-encoded values from databases and logs
  • Solving capture-the-flag and puzzle challenges
  • Inspecting file headers and magic numbers
  • Checking the output of your own hex encoding code

Technical details & standards

Continuous hex is read two digits at a time, so 48656C6C6F becomes the bytes 48 65 6C 6C 6F; with spaces or commas, each value is one character code. Each code is converted to its character: 0x20 is a space, 0x30 to 0x39 are digits, 0x41 to 0x5A are A to Z and 0x61 to 0x7A are a to z.

ASCII covers codes 00 to 7F; bytes 80 to FF map to Latin-1 characters. UTF-8 text containing multi-byte characters, such as C3 A9 for é, is shown as two separate characters rather than reassembled, so decode such data with a UTF-8 aware tool. Control characters below 20 are invisible.

Hex to string in Python and JavaScript

To decode hex to a string in code, turn the digit pairs into bytes and decode the bytes as text. Spaces between bytes are fine in Python's bytes.fromhex.

Python

bytes.fromhex("48656c6c6f").decode("ascii")   # 'Hello'
bytes.fromhex("48 65 6C 6C 6F").decode()      # 'Hello', UTF-8 by default

JavaScript

Buffer.from("48656c6c6f", "hex").toString("utf8");  // "Hello" (Node.js)
"48 65 6C 6C 6F".split(" ")
  .map(h => String.fromCharCode(parseInt(h, 16))).join("");  // "Hello" (browser)

Frequently asked questions

How do I convert hex to text?

Split the hex into pairs, convert each pair to a number and look up its ASCII character. 4869 is 48 69, which is 72 105, or "Hi".

What does 48 65 6C 6C 6F mean?

"Hello": 48 is H, 65 is e, 6C is l and 6F is o.

Why does my decoded text show strange characters?

The hex may be UTF-8 with multi-byte characters, binary data that is not text, or misaligned because of a missing digit. Check that the length is even and the data really is text.

How do I convert hex to text on the command line?

Use echo 48656c6c6f | xxd -r -p on Linux and macOS. In Python: bytes.fromhex("48656c6c6f").decode().

What is a hex decoder?

A hex decoder turns hexadecimal back into the data it encodes. For text, every two hex digits are one character code, so a hex to text decoder like this one turns 48 69 into "Hi". For other data, such as Gzip or Base64, use the matching decoder.

What is 0x20 in ASCII?

0x20 is a space character.

What is 0x70 in ASCII?

0x70 is a lowercase p, which is 112 in decimal.

More converters tools

View all