Hex Encode

Paste your text below and click Encode to convert it to a hexadecimal string. All processing happens locally in your browser.

Copied!

What is Hex Encoding?

Hexadecimal encoding converts each byte of data into a two-character hex string (00ff). This is useful for inspecting binary data, debugging network protocols, and representing byte arrays in code.

UTF-8 characters that use more than one byte will produce multiple hex pairs.

The separator and letter case are yours to choose: nothing between the bytes for a compact string, spaces for readability, or colons for the style fingerprints and MAC addresses are usually written in. Everything happens in your browser.

Debugging something that will not decode?

A payload that will not decode is usually a symptom rather than the fault: a double encoding somewhere in the pipeline, a charset assumed instead of declared, a token signed over bytes that are not quite the bytes anyone expected. We do this kind of work, on integrations, APIs and the systems that pass data between them.

Tell us what is breaking

Frequently Asked Questions

What is hex encoding used for?
Hex is what you reach for when a person has to read the bytes. Hashes, checksums, cryptographic keys, colour values, MAC addresses, memory dumps and packet captures are all shown in hex because each byte becomes exactly two characters, so positions line up in columns and a single wrong byte is obvious at a glance. It is also the usual way to paste binary data into source code.
How is hex encoding different from Base64?
Hex costs more and reads better. Every byte becomes two characters, so the output is exactly twice the input, where Base64 is about a third larger. In exchange, hex has a fixed and obvious mapping: you can point at a pair and know which byte it is, count offsets by eye, and change one byte without disturbing anything around it. Base64 wins where size matters, hex wins where a human is looking.
Why does one character sometimes become several hex pairs?
Because hex encodes bytes, not characters, and text becomes bytes through UTF-8. Anything in the ASCII range is one byte and therefore one pair. Accented Latin letters, Greek and Cyrillic take two bytes, most CJK characters take three, and emoji take four. So a five character string can easily come out as twenty hex pairs.
Which separator should I choose?
It depends on where the output is going. Nothing between the bytes is what code and most APIs expect, and it is the shortest. Spaces make a long string readable and are what you see in a dump. Colons are the convention for certificate fingerprints and MAC addresses. The bytes are identical in all three; only the punctuation between them changes.
Is hex encoding the same as hashing?
No, though the two are usually seen together. A hash is a one way function: it reduces any input to a fixed size digest that cannot be turned back into the original. Hex is a reversible way of writing bytes down. Hashes are normally displayed in hex, which is why the two look alike, but hex encoding a password gives you no protection whatsoever, only a longer version of the same password.