What this tool does
Hexadecimal is the byte microscope of computing: each byte becomes 2 characters from 0–9/A–F, making all 256 values legible at a glance. When reading packet captures, comparing file magic numbers (PNG's 89 50 4E 47, PDF's 25 50 44 46) or debugging binary formats, hex is the universal language.
This page converts both ways between text and hex: text is UTF-8 encoded into bytes; the decode direction tolerates spaces, newlines, commas, underscores and 0x prefixes — whatever format your log, packet tool or code produced, just paste it. Everything is converted locally.
How to use
- Text → Hex Chinese characters take 3 bytes (6 hex chars) each under UTF-8. Options control byte grouping and letter casing.
- Hex → Text Whitespace and 0x prefixes are cleaned automatically before parsing; odd length or illegal characters are reported precisely instead of guessed.
FAQ
Why is one Chinese char 6 hex characters?
Common CJK chars take 3 bytes in UTF-8, 2 hex chars each. GBK uses 2 bytes — if you expected 4 chars, the peer is GBK while this tool is UTF-8.
Are 0x prefixes and commas supported?
Decoding strips 0x prefixes, spaces, newlines, commas, semicolons and underscores. Encoding output grouping is controlled by options.
What about "odd length" errors?
Hex needs 2 chars per byte; odd length means a character was lost in copying. Check the head and tail first — the most common loss points.
Can it convert binary files?
Decoded results must be valid UTF-8 text; binary errors out clearly. For file hex dumps use an editor with a hex view or xxd.
Hex vs Base64?
Hex is lossless and directly readable at twice the length; Base64 is 33% more compact but opaque. Debug with hex, transport with Base64.
Is my content uploaded?
No. Conversion runs in a browser Worker; content never leaves your device.
Limits
Up to 2MB per run; encoding is UTF-8 — no GBK/Big5 legacy encodings.
Decoded results must be valid UTF-8 text: binary content errors out, no mojibake.
Parsing tolerates whitespace and 0x prefixes, but not addressed hex formats like srec/intel-hex.