How to Convert Hexadecimal Back to Text
Hex Decoding
When to Hex-Decode
Decode hex when reading memory dumps, converting protocol captures back to strings, verifying encoded payloads, or recovering text from debugging output.
Real-World Examples
48656c6c6f → Hello
41 42 43 → remove spaces, then decode to ABC
Common Mistakes
- Odd-length hex strings (must have an even number of hex digits)
- Leaving
0xprefixes or separators in the input — these are stripped automatically - Assuming decoded bytes are UTF-8 text when they may be binary or another encoding
Edge Cases
- Non-hex characters (spaces, colons,
0xprefixes) are stripped automatically with a warning — only letters g-z and other invalid hex cause failures - Valid hex that is not valid UTF-8 produces replacement characters or errors
Developer Tips
- Strip whitespace and prefixes before decoding
- Specify byte encoding explicitly when moving between systems
Frequently asked questions
Why does decoding fail on my hex string?
Common causes are odd digit count, non-hex characters, or spaces/0x prefixes that were not removed.
Why is decoded output garbled?
The bytes may not be UTF-8 text. They could be another encoding or raw binary data.
Can I paste hex with spaces?
Yes. Spaces, colons, and 0x prefixes are stripped automatically before decoding.