Hex Converter
Text to hex and hex back to text in UTF-8, with space separators or a 0x prefix.
How to Use
- Pick a direction
Text to hex shows how a string looks in memory; hex to text restores bytes copied out of a capture.
- Choose the output format
Spaces suit byte-by-byte comparison, run-together text suits pasting into code, and the 0x prefix suits data copied from C or a memory dump.
- Check the byte count
The byte count tells you whether Chinese was read as GBK — more bytes than expected means the encoding is wrong.
FAQ
Why does Chinese take three bytes?
UTF-8 is variable-length: the ASCII range (0 to 127) uses one byte, common Chinese characters use three, and rarer characters and emoji use four. Latin letters and digits take one byte each, so pure ASCII becomes twice as long in hex.
How is hex different from Base64?
Hex spends ten characters on four bits, so a byte becomes two characters: the length doubles but the result stays readable and editable. Base64 spends 64 characters on six bits, so a byte becomes 1.33 characters: better compression but unreadable. Hex is for debugging and memory dumps, Base64 for transport and embedding.
The decoded Chinese comes out as garbage, what now?
Almost always an encoding mismatch. Hex carries no encoding information, so GBK bytes read as UTF-8 produce nonsense. This tool always assumes UTF-8 because that is the de facto standard now; data exported by legacy systems as GBK needs a dedicated encoding converter first.
Can I paste hex with a 0x prefix?
Yes. The decoder strips any 0x or 0X prefix and treats spaces, commas, colons and semicolons as separators, so hex copied straight out of C code, a memory dump or a register view can be pasted as is.