Hex Encoder/Decoder + Dump Viewer
Convert bytes to hex and back, and inspect any file in a classic offset/hex/ASCII dump — entirely on this device.
Formatting options change the hex text only — never the bytes.
Press ? for shortcuts
Do it offline:$ xxd -r -p hex.txt
How to use it
- Paste hex or plain text — the direction is detected and shown, and the ⇄ control (or the s key) swaps it. Input that is valid both ways gets a banner offering both readings, never a silent guess.
- Shape encoded output with the options: lowercase or uppercase digits; no separator, spaces or colons; a 0x prefix per byte; a bytes-per-line width.
- Drop a file — up to 32 MB — or use the picker button, and read it as a dump: sixteen bytes per row, non-printable bytes as ·.
- Copy or download — hex and dump text as .txt, decoded bytes as raw .bin. Share links carry tool state; file contents never enter a URL.
Paste hex to get the original text back, or text to get hex — the direction is detected, never asked first. Drop a file up to 32 MB to read it as the classic offset/hex/ASCII dump. Decorations — 0x prefixes, \x escapes, separators, mixed case — are declared as chips, and nothing you paste or drop leaves this device.
Examples
Hi!48 69 21The encode defaults: lowercase digits, one space between bytes. Uppercase, colons, 0x prefixes and fixed line widths are one option away.
48656c6c6f2c20576f726c6421Hello, World!The decode direction — a continuous lowercase string is confidently hex. The bytes are validated as UTF-8 before they are shown as text.
48:65:6c:6c:6f:2c:20:57:6f:72:6c:64:2100000000 48 65 6c 6c 6f 2c 20 57 6f 72 6c 64 21 |Hello, World!|The same thirteen bytes pasted the way a capture prints them — colons declared as a chip — viewed as a dump: offset gutter, hex column, printable-ASCII column.
Every example on this page is executed against the same engine that powers the tool, on every build.
Gotchas worth knowing
Decorated hex pastes straight in — strict mode refuses it
Code carries 0x prefixes and \x escapes, captures insert colons or spaces, and cases mix. All four decorations are accepted and each is declared as an info chip — no repair is silent. Strict mode flips them into position-anchored errors for conformance checking.
Short hex-shaped input can be plain text too
Any string built from a–f and digits is valid hex and valid text at once — deadbeef is the classic case. Long, evenly paired runs decode with confidence; short ones raise a banner offering both interpretations one keystroke apart.
Multi-byte UTF-8 straddles dump rows without breaking
An é or a ☕ is several bytes, and a sixteen-byte row can split them. The ASCII column never renders them — anything outside printable ASCII appears as · — so the dump never shows broken half-glyphs.
Decoded bytes render as text only when they really are text
Decode output must survive strict UTF-8 validation to reach the text pane; bytes that fail — or that carry null or control bytes — switch the output to the announced dump view. Copy and download always carry the real bytes.
The 32 MB limit is a refusal, never a truncation
Past 32 MB the page refuses with a banner naming the limit; nothing is trimmed. xxd file.bin dumps any size, and when the real question is integrity, a checksum (shasum -a 256 file.bin) answers without loading the bytes anywhere.
Common errors
Odd number of hex digits — byte 7 is incomplete- Two digits make one byte, so valid hex has an even count. The message names the first incomplete byte, counting from one, and a caret marks it. The usual cause is a truncated copy — recover the lost digit rather than trimming strays.
`g` at position 12 is not a hex digit- Positions count from one across exactly what you pasted, and Jump to error puts the cursor there. A g is either a typo or a sign the string is not hex at all — Base64 and ordinary prose both use letters beyond f.
Input is larger than the 32 MB limit for this tool. For bigger payloads use the CLI: xxd -r -p hex.txt- A refusal, never a truncation: the input stays where it is. On the command line, xxd -r -p hex.txt turns hex back into bytes and xxd file.bin dumps a file of any size.
FAQ
How do I convert text to hex?
Paste it — text is detected and encoding preselected — and each UTF-8 byte appears as a two-digit pair. Options set the case, separator, 0x prefixes and bytes per line. Both directions share this one page; the swap control flips them.
How do I read the hex dump view?
Each row is sixteen bytes: the row's starting offset on the left, the bytes as pairs in two eight-byte halves, and printable ASCII — with · for everything else — on the right. It is the layout xxd prints; a plain-text export provides a linearized copy for screen readers and diffs.
What hex formats can the decoder read?
Continuous pairs; spaced, colon- or comma-separated bytes; line-broken listings; 0x-prefixed bytes; \x-escaped strings; any mix of cases. Each accepted deviation is declared as a chip, and strict mode turns the same tolerances into position-anchored errors — conformance instead of recovery.
Can I use this instead of xxd?
For inspecting and converting, yes — the same offset/hex/ASCII dump, fed by pasted input or a dropped file up to 32 MB, on machines where xxd cannot be installed. The file is read on this device and never uploaded. Beyond 32 MB, xxd itself is the right tool.
Keyboard shortcuts
- ⌘/Ctrl + Enter
- Run now — convert a large input immediately, or force a re-run.
- ⌘/Ctrl + S
- Download the output — .txt for hex or dump text, .bin for raw bytes (downloads instead of saving the page).
- ⌘/Ctrl + C
- With nothing selected, copy the primary output — the plain-text dump in dump view.
- ⌘/Ctrl + Shift + C
- Copy the output, live selection or not.
- s
- Swap the direction (single-key; inactive in text fields and under the kill switch).
- t
- Cycle the color theme (same single-key rules).
- ? or ⌘/Ctrl + /
- Show the shortcut overlay, including the browser-conflict notes.
- Esc
- Close the topmost overlay — never the input.