Hex Encode / Decode
?
About hex encoding
- What is hex encoding?
- Hex (base16) encoding represents each byte of data as two hexadecimal digits (00–ff). It is a compact, human-readable way to inspect, log, or transmit binary data using only the characters 0–9 and a–f.
- What's the difference between hex and Base64?
- Both represent binary data as text, but hex uses a fixed 2 characters per byte — easy to read and debug — while Base64 packs roughly 4 characters per 3 bytes, denser but less readable. Hex is usually preferred for hashes, colors, and byte-level debugging; Base64 for larger payloads like files embedded in JSON or URLs.
- Why does decoding accept spaces, colons, and 0x prefixes?
- Real-world hex dumps show up in many shapes — "48 65 6c 6c 6f", "48:65:6c:6c:6f", "0x48 0x65…" — so decoding strips whitespace, separators, and 0x/\x prefixes and just reads the hex digits themselves.
- Does hex encoding operate on characters or bytes?
- Text is first converted to UTF-8 bytes, then each byte becomes two hex digits; decoding does the reverse. Multi-byte characters — accents, emoji, CJK — take multiple bytes and hex pairs, the same as in Base64.
- Does this tool upload my data anywhere?
- No. Encoding and decoding happen entirely in your browser using standard Web APIs. Nothing you type or paste ever leaves your device.
Configuration options
- Uppercase
- Outputs hex digits as AB instead of ab. Purely cosmetic — decoding accepts either case, and mixed case, without needing this on.
- Space-separated
- Inserts a space between each byte pair, e.g. 68 65 6c 6c 6f, for readability. Decoding works the same whether or not the input has spaces.
Convert text to and from hexadecimal byte strings. UTF-8 safe.
- input chars
- 0
- output chars
- 0
- status
- idle