Hex Encode/Decode

Convert text to and from hexadecimal, space-separated supported, UTF-8 based

Encode Decode
Chars: {{ inputText.length }}
{{ error }}
Base64 Encode →

About Hex Encoding

Hex (hexadecimal) uses base 16, representing each byte (8 bits) as two hex digits with 0-9 and a-f. It is the most intuitive way to inspect and debug binary data — every byte maps to a fixed-length readable pair, more readable than raw binary and closer to the metal than Base64.

This tool is UTF-8 based: a non-ASCII character is first converted to its UTF-8 byte sequence, then output byte-by-byte as Hex. For example, "€" in UTF-8 is E2 82 AC.

Examples

Input: Hello → Output: 48656c6c6f

With space-separated: 48 65 6c 6c 6f

FAQ

Q: Decode says "length must be even"?
A: Each pair of hex characters represents one byte, so the total number of characters must be even. Check whether you dropped a character or a trailing 0.
Q: Why is non-ASCII Hex so long?
A: A Chinese character takes 3 bytes in UTF-8, so it maps to 6 hex characters. This is a UTF-8 characteristic, not an error.