Contact

Tools  /  Encoding  /  Hex Encoder / Decoder

Hex Encoder / Decoder

Convert text to and from hexadecimal — with separators, prefixes, a hex dump view and file support.

What this tool does

Text converts to hexadecimal and back in either direction, with full control over exactly how the hex is formatted — and it is not limited to typed text: a file dropped in is read as raw bytes, so its actual binary content can be inspected as hex, not just a text string.

Working with any file, not only typed text

Opening a file reads its bytes directly rather than trying to interpret it as text first, so an image, an executable, or any other binary file can be inspected the same way a plain string would be. Decoding hex back the other way can produce a real downloadable binary file too, not only decoded text — a full round trip from bytes to hex and back to bytes.

The xxd-style hex dump

Turning on the dump view lays the bytes out the way the classic Unix xxd/hexdump -C tools do: a hexadecimal offset, sixteen bytes per row grouped into two columns of eight, and the same bytes shown again as printable ASCII (or a dot for anything that is not) on the right — the standard format for actually reading what is inside a file, not just a raw hex string with no structure.

Formatting hex for wherever it is going

Plain hex means different things in different contexts, so the separator (space, comma, colon, dash, or none), an optional 0x or \x prefix per byte, letter case, and how many bytes appear per line are all independently controlled — matching whatever a byte array literal in source code, a config file, or a log format actually expects, rather than one fixed style. Decoding is lenient about all of this too: prefixes and any stray non-hex characters in pasted input are stripped automatically before the hex is read.

Privacy

Encoding, decoding, and reading a file all happen in your browser. Nothing you paste, drop, or load is sent to a server.

Frequently asked questions

Is my data uploaded anywhere?
No. Encoding, decoding, and reading a file all run locally in the browser — nothing is sent to a server.
Can it hex-dump a binary file, not just typed text?
Yes — opening a file reads its actual bytes directly, so an image, an executable, or any other binary file can be viewed as hex the same way a plain text string would be, not only files that happen to be readable as text.
What is the xxd-style dump view?
It lays bytes out the way the classic Unix xxd and hexdump -C tools do: a hex offset, sixteen bytes per row split into two groups of eight, and the same bytes shown again as printable ASCII on the right, which is the standard way to actually read the contents of a file rather than one long unstructured hex string.
Can hex be decoded back into a binary file, not just text?
Yes — decoding can produce a real downloadable binary file from the hex, completing a full round trip from bytes to hex and back, not only a decoded text string.
What do the prefix and separator options actually do?
They control the exact shape of the hex output -- adding a 0x or \x prefix to each byte, choosing space, comma, colon, dash, or no separator between bytes, and setting how many bytes appear per line -- to match a byte array literal in source code, a config file, or whatever format the hex actually needs to fit.
Does it handle hex that has mixed formatting when decoding?
Yes — 0x and \x prefixes and any characters that are not valid hex digits are stripped automatically before decoding, so pasted hex with inconsistent spacing or prefixes still decodes correctly.
Theme Accent