Text Tools

Hex to String

Convert hex-encoded text back into plain text directly in the browser.

Start here Paste the hex string; spaces and line breaks between the pairs are ignored.

Decoded text

Encode this developer note.

Understand the format

How Hex to String works

Decoding hexadecimal reassembles pairs of digits into bytes and reads them as UTF-8 text, which tells you whether a hex blob was ever text in the first place.

From digit pairs back to characters

Each pair of hexadecimal digits becomes one byte, and the resulting byte sequence is decoded as UTF-8. Because two digits are consumed at a time, alignment is everything: drop a single digit anywhere in the string and every byte after that point is wrong, which typically produces a run of replacement characters rather than a clean failure.

This decoder ignores whitespace, so hex copied from a debugger or a packet dump in space-separated or line-wrapped form works without cleanup. It does require an even number of digits and rejects anything outside 0-9 and a-f, which catches truncated copies early.

Not every hex blob is text

Hex is used to print bytes of any kind. A digest, an encrypted payload, a compressed stream, or a binary protocol frame all decode into byte sequences that are not valid text, and the output will contain replacement characters. That result is still informative: it rules out the assumption that the value was a string.

A useful signal is the byte range. Sequences made mostly of 20 to 7e are printable ASCII and very likely text. Sequences with many bytes above 7f that do not follow UTF-8 continuation rules are binary data or a different encoding.

Step by step

How to use Hex to String

  1. Paste the hex string; spaces and line breaks between the pairs are ignored.
  2. Read the decoded text, or the error banner if the input has an odd length or contains non-hex characters.
  3. If the output is full of replacement characters, treat the value as binary rather than text.
  4. Strip 0x prefixes and separators such as colons before pasting if the source used them.

Decoding runs in the browser with TextDecoder. Protocol captures and stored values pasted here are never transmitted.

Worked examples

Hex to String examples explained

A plain ASCII value

Input

4869

Result

Hi

Two byte pairs, two characters. Values entirely in the 20 to 7e range are almost always readable text.

Multi-byte UTF-8

Input

e282ac

Result

Three bytes, one character. Splitting this sequence would produce replacement characters rather than a partial symbol.

Reference

Diagnosing a hex string before decoding it

Diagnosing a hex string before decoding it
ObservationLikely meaningNext step
Odd number of digitsTruncated or mis-copied valueRe-copy the complete string.
Contains g-z or punctuationNot hexadecimal, or a separator was includedRemove 0x prefixes, colons, and commas.
Exactly 32 or 64 digitsAn MD5 or SHA-256 digestDigests are not text; compare them rather than decoding.
Mostly 20 to 7ePrintable ASCIIDecodes cleanly to readable text.
Starts 1f 8bA gzip streamDecompress before attempting to read it.

Practical Guide

How teams use Hex to String

Common use cases

  • Read protocol samples, encoded fixtures, and stored values while debugging.
  • Verify whether a hex blob actually contains the text you expect.
  • Translate legacy output into a form the rest of the team can review quickly.

Checks before trusting the result

  • Invalid or incomplete digit pairs prevent decoding entirely, which is a useful early signal.
  • Decoded output may still contain control characters that do not render.
  • If the result looks wrong, confirm the original value was text rather than binary data.

Troubleshooting

Common mistakes and how to fix them

Trying to decode a SHA-256 digest back into its input.
A digest is not encoded text. Those 64 digits are the output of a one-way function and decode into 32 bytes of noise.
Pasting hex that includes 0x prefixes or colon separators.
Remove them first. Whitespace is ignored, but other separators are treated as invalid characters.
Concluding the source is corrupt because the output shows replacement characters.
The bytes decoded fine; they simply are not UTF-8 text. Identify the real format before going further.

FAQ

Hex to String questions, answered

Why does decoding fail with an odd-length error?

Every byte needs exactly two digits. An odd count means at least one digit was lost when the value was copied.

What are the black diamonds in the output?

Unicode replacement characters, inserted where the bytes are not valid UTF-8. They indicate binary data or a different character encoding.

Does letter case matter?

No. Uppercase and lowercase hexadecimal digits are equivalent, and both are accepted.

Can I decode a hex-encoded file back to a download?

Not here; this panel produces text. Use xxd -r -p or an equivalent utility to rebuild binary files.

Is hex the same as Base16?

Yes. RFC 4648 defines Base16, which is hexadecimal with uppercase digits. The bytes are identical either way.

Go deeper

Specifications and guides