Hex Encode / Decode
Encode text as hex bytes or decode a hex string back to text. Choose the byte separator (none, space, colon, 0x, \x) and case. UTF-8 throughout.
🔒 100% Client-Side & Private — processed locally in your browser. Files never leave your device.
Options
Your result will appear here
Type or paste your input above, adjust the options, then press Run. Tip: press Ctrl+Enter to run, and ? for every shortcut.
How it works
Two directions over the same bytes
Encoding reads your text as UTF-8 and prints each byte as two hexadecimal digits; decoding does the reverse, parsing hex pairs back into bytes and decoding them as UTF-8 text. Nothing is interpreted as a number, so an arbitrary character string survives the trip unchanged.
Choosing separators and case
The separator option shapes encoding output for whichever consumer you have: no separator for a compact blob, a space or colon between bytes for logs and certificates, a 0x prefix for C-style arrays and \x for Python or shell escapes. Uppercase switches the digits themselves. In decode direction the separators do not matter — all of them are stripped before parsing.
Errors it catches for you
An odd number of hex digits is rejected with an explanation instead of being padded, because a missing nibble means the input was truncated. On decode, bytes that are not valid UTF-8 produce U+FFFD replacement characters and the result carries a note, which tells you the payload was probably binary or in another encoding.
Byte-for-byte local conversion
Both directions use the TextEncoder and TextDecoder built into the browser, so no library is downloaded and no request leaves the page. You can paste private keys or tokens here to inspect their bytes without the value being transmitted anywhere.
Questions
What input does decoding accept?
Any hex string. Spaces, colons, newlines, 0x and \x prefixes are ignored, so you can paste output from most tools directly.
What counts as one byte when encoding?
Two hex digits. Encoding always works on UTF-8 bytes, so a non-ASCII character such as é becomes two bytes, c3 a9. Decoding refuses an odd number of hex digits outright rather than guessing where the byte boundary falls.
Why do I see replacement characters after decoding?
The decoder always interprets the bytes as UTF-8. Bytes that are not valid UTF-8 are replaced with U+FFFD and the tool adds a note, so a mangled result is flagged instead of quietly returned as if it were correct text.
Related tools
See categoryBase64 Encode / Decode
Convert text or a file to and from Base64, with URL-safe and MIME line-wrap options.
Base32 Encode / Decode
RFC 4648 Base32 and Crockford Base32 encoding and decoding of text.
Text to Binary
Encode text as 8-bit binary (UTF-8 aware) or decode a string of 0s and 1s back to text.
Quoted-Printable Encode / Decode
Encode or decode MIME quoted-printable (=XX escapes, soft line breaks).