Hex Encoder

Show the hexadecimal bytes behind any text.

Reverse
Input
TEXT input
Output
Result
Options

About this tool


Hexadecimal shows you the actual bytes of a string, two digits each. It is the representation you want when debugging an encoding problem, comparing what a protocol sent against what it should have sent, or working out why a string that looks correct is failing a comparison.

Hex is how you see invisible characters. A zero-width space, a byte order mark or a non-breaking space are all indistinguishable from ordinary whitespace on screen, but each has an unmistakable hex signature.

How to use it

  1. Paste or upload your textDrop a file onto the input pane, use the file picker, or paste the text directly.
  2. Adjust the options if neededThe defaults suit most input; open Options to change the behaviour.
  3. EncodePress Encode, or use Ctrl+Enter (Cmd+Enter on macOS).
  4. Copy or downloadCopy the result, or download it as a .txt file.

Worked examples


Each example below is executed against this tool by the test suite, so what you see is what the tool actually produces.

ASCII text

Input

Hi

Output

48 69

H is 0x48 and i is 0x69 in ASCII.

Multi-byte characters

Input

é😀

Output

c3 a9 f0 9f 98 80

Two characters, six bytes: é takes two and the emoji four.

What to watch for


The details that decide whether a conversion is correct, and where information can be lost without any error being raised.

Text becomes UTF-8 bytes first
Hex represents bytes, not characters, so the string is encoded as UTF-8 before conversion. ASCII characters produce one byte each, accented Latin characters two, most CJK characters three, and emoji four. This is why a 2-character emoji string yields 8 hex digits.
Finding invisible characters
This is the practical use. A non-breaking space is C2 A0 rather than the ordinary 20, a zero-width space is E2 80 8B, and a UTF-8 byte order mark at the start of a file is EF BB BF, the usual reason a first CSV column name fails to match. None are visible in an editor; all are obvious in hex.
Separators are for reading only
Spaces or colons between bytes carry no information; they just make output scannable. Colon-separated hex is the convention for MAC addresses and certificate fingerprints, while unseparated hex is what you want when pasting into code.

Limitations


  • Encodes text as UTF-8; other encodings such as Latin-1 are not supported.
  • Processing happens in your browser, so very large inputs are bounded by available memory. Files above roughly 10 MB are handled but will feel slower, and multi-hundred-megabyte files are better suited to a command-line tool.

Questions


Why are there more hex bytes than characters?
Because non-ASCII characters take several UTF-8 bytes each, two for most accented letters, three for CJK, four for emoji.
How do I find a hidden character in my text?
Encode it and look for unexpected bytes. C2 A0 is a non-breaking space, E2 80 8B a zero-width space, and EF BB BF a byte order mark.