Hex Decode

Decode hexadecimal byte strings back to readable text, with or without spaces or a 0x prefix. UTF-8 aware, runs entirely in your browser.

Loading tool…

Worked examples

  • Compact hex bytes

    The everyday case: pasting a compact hex string from a debugger, packet dump or hex editor back to readable text.

  • Space-separated hex with a multi-byte character

    Whitespace between byte pairs is stripped automatically, and the bytes are decoded as UTF-8 so accented characters come back correctly.

  • Hex with an invalid character

    A 'g' isn't a hex digit — the tool reports exactly what's wrong instead of silently dropping or mangling the invalid character.

What this tool does

This tool reverses hex encoding: it takes a string of hexadecimal digits, pairs them up into bytes, and decodes those bytes back to readable UTF-8 text — entirely in your browser. It accepts hex with or without spaces between byte pairs, and tolerates an optional leading 0x prefix.

When you need it

  • Converting a hex string copied from a debugger, hex editor, or packet capture back into the text it represents. Only plain hex digits are accepted (optionally with one leading 0x); per-byte formats such as 0x48, 0x69 or Hi need their prefixes and commas removed first.
  • Checking what a hex-encoded value in a config file, database column, or API payload actually says without writing a script.
  • Verifying a hex-encoding step elsewhere in your code by round-tripping a known value back to plain text.
  • Following up on output from the companion Hex Encode tool to confirm a value encodes and decodes back to exactly what you started with.

How decoding works

  1. Whitespace is stripped first. Spaces, tabs and newlines between byte pairs (the format most hex editors display) are removed automatically, so you can paste hex exactly as shown without manual cleanup. A leading 0x prefix, if present, is also stripped.
  2. The remaining characters are grouped into pairs, and each pair is parsed as one byte, a value from 00 to ff.
  3. The bytes are decoded as UTF-8 text. If the bytes don't form valid UTF-8 — which happens if the hex actually represents binary data rather than text — invalid sequences are replaced with the Unicode replacement character (�) instead of causing an error, so you still see as much readable content as possible.
  4. Two specific problems are checked and reported clearly: a character that isn't a valid hex digit (anything outside 0-9, a-f, A-F), and an odd number of hex digits, which means a byte is incomplete. Both cases stop decoding and explain exactly what's wrong rather than guessing or silently truncating.

Why hex must come in pairs

Every byte needs exactly two hex digits to represent its full range of 256 possible values — one digit alone can only represent 16 values. A hex string with an odd number of digits after removing whitespace is missing a digit somewhere, most often from a copy-paste that got cut off partway through the last byte. This tool flags that condition explicitly instead of dropping the trailing digit and decoding a truncated, misleading result.

Things to check after decoding

  • If the output contains replacement characters (�), the original bytes likely weren't UTF-8 text at all — they may be a different encoding, compressed data, or genuinely binary content like an image fragment.
  • If you get an "odd number of hex digits" error on a string you're confident is correct, check for a stray trailing or leading character that isn't part of the intended byte data.
  • Case doesn't matter for decoding — 4A and 4a are treated identically, since hex digit case is purely a display convention.

Limits

Input is capped at 2 MB of text. This tool decodes hex to text; if the underlying bytes are a binary file rather than text (an image, an executable, compressed data), the decoded output will not be meaningful — you'd need a file-based tool to reconstruct the original binary.

Frequently asked questions

Is my hex uploaded anywhere?
No. Decoding runs entirely in your browser; nothing is sent to a server.
Does this accept spaces between bytes?
Yes — all whitespace is stripped before decoding, so both compact hex and space-separated hex (as shown by most hex editors) work without any changes.
Why do I get an 'odd number of hex digits' error?
Each byte needs exactly two hex digits, so a valid hex string always has an even length. An odd length means a digit is missing or extra.
What if the decoded bytes aren't valid UTF-8 text?
The decoder falls back to Unicode replacement characters (�) for invalid byte sequences rather than throwing, since the input may be binary data rather than text.