Hex Encoder and Decoder
Encode text or uploaded files as lowercase hexadecimal, or decode hex back to binary.
Runs in your browser — your input is processed on this device and never uploaded.
Input
Encode data as hexadecimal or decode hexadecimal text back to binary data.
Layout of the encoded output. Plain hex is one continuous run of digits. Hexdump adds an offset column and a readable text column, the way the hexdump command shows a file. Applies to Encode.
Text placed between the byte groups, so a space gives 66 6f 6f. In the hexdump layout it separates the bytes inside a group instead. Applies to Encode.
Result
Results appear here.
About this tool
On this page
What is hexadecimal encoding?
Hex writes each byte as exactly two characters drawn from the digits 0 to 9 and the letters A to F. A 10-byte input becomes 20 hexadecimal characters. This tool writes lowercase by default and accepts either case when decoding.
Hex encoder options
- Operation
- Encode (the default) or Decode. Decode turns valid hexadecimal back into the original bytes.
- Data
- Typed text or uploaded files. Several inputs per run are fine, and results arrive as files.
- Layout
- Plain (the default) is one continuous run of digits. Hexdump adds an offset column and a readable text column, the way the hexdump command shows a file.
- Uppercase
- Off by default. Turn it on to write ABCDEF instead of abcdef.
- Separator
- None (the default), space, comma, colon, dash, underscore or newline, placed between byte groups, so a space gives 66 6f 6f.
- Bytes per group
- From 1 to 64, default 1. Digits inside a group are written together, so 2 gives 666f 6f62 6172.
- Prefix
- None (the default),
0x,\xor%, written in front of a group so you can paste the hex straight into code. The hexdump layout ignores it. - Prefix placement
- In front of every group (the default), or only once at the start.
- Bytes per line
- Start a new line after this many input bytes, up to 1024. The default, 0, keeps plain hex on one line and gives hexdump its usual 16 bytes per line.
- ASCII column
- On by default. Shows the readable text column in the hexdump layout.
- The layout settings apply to Encode only.
Why hex, when it doubles the size
Because you can read it. The mapping is positional and fixed: byte three of the file is always characters five and six of the output. Nothing shifts, nothing is grouped across boundaries, and you can point at a spot in the middle of a hex dump and know exactly which byte you are looking at.
That property is why hex is the standard way to show hashes, checksums, memory dumps, file signatures, colour values, and anything else a person needs to compare by eye. Base64 is denser and completely opaque to that kind of inspection.
Hex alternatives
Base64 costs about a third in overhead against hex's 100 percent, and is the better pick when nobody reads the output. Base32 sits between the two and survives case-mangling. Ascii85 is denser than all of them.
For eyeballing the first bytes of an unknown file, hex remains the most direct option.
Things to know about hex
Hex gets confused with hashing because hashes are nearly always shown in hex. The hash does the fingerprinting. The hex only makes the result printable, and on its own it protects nothing.
Because two characters map to exactly one byte, valid hex always has an even length. An odd number of characters means something was truncated.
Browse
Find similar tools by category or tag.