Skip to content

Hex Encode

Convert text to hexadecimal (Base16) with a choice of separator, casing and source character set.

Input

Output

Hexadecimal, byte by byte

Hex writes each byte as exactly two characters, 00 to ff. Unlike Base64 it does not compress anything — the output is always twice the input — but it maps one-to-one onto bytes, which is what makes it the format of choice for hashes, keys, colour values and memory dumps.

The decoder is deliberately forgiving: 0x prefixes, \x escapes, colons, dashes and line breaks are all stripped before parsing, so you can paste output from openssl, xxd or a debugger without cleaning it up first.

Frequently asked questions

Can I paste hex with 0x prefixes or colons?

Yes. 0x, \x, spaces, colons, dashes, underscores and newlines are all removed automatically before decoding.

What happens with an odd number of digits?

A zero is prepended to the first byte, since an odd digit count almost always means a truncated paste rather than an intentional value.

Related tools