LocalFirstTools.com — data tools that never leave your device
No upload — everything runs on your device

Hex Encode / Decode

Convert text and bytes to hexadecimal and back. Nothing is uploaded.

The Hex tool maps every UTF-8 byte to exactly two hexadecimal characters — doubling the size on encode, halving it on decode — entirely in the browser.

Text
Hex (UTF-8 bytes)
Converted locally — nothing leaves this tab

What does the Hex do?

Hexadecimal (base16) writes every byte as two characters from 0-9 and a-f, which is how bytes appear in packet dumps, debuggers, checksums and protocol specs. This tool encodes text to its UTF-8 hex bytes and decodes hex back into text.

How does the Hex work?

Encoding runs your text through the browser's TextEncoder to get UTF-8 bytes, then maps each byte to two lowercase hex digits — the base16 alphabet defined in RFC 4648 §8. Decoding strips whitespace and 0x prefixes, accepts uppercase, then rebuilds the bytes and decodes them with TextDecoder in strict mode, so invalid UTF-8 produces a clear error instead of garbled output. Everything runs in this tab.

Does this upload my data?

No. This page never sends your input to a server — formatting, decoding and hashing all run in this tab, on this device.How that works.

Frequently asked questions

Why does é encode to c3a9 instead of one byte?

Text is encoded as UTF-8 first, and é (U+00E9) takes two bytes in UTF-8: 0xC3 0xA9. Any character outside basic ASCII uses two to four bytes, so the hex for café is 63 61 66 c3 a9 — five bytes for four characters.

How does hex compare to Base64 in size?

Hex doubles the data: every byte becomes exactly two characters (2× the byte count). Base64 packs three bytes into four characters, about 1.33×. Hex is bigger but trivially readable byte-by-byte, which is why debuggers and specs prefer it.

What input formats does decoding accept?

Lowercase or uppercase digits, spaces or line breaks between bytes, and 0x prefixes — 0xC3 0xA9, c3a9 and C3 A9 all decode identically. Everything except the hex digits themselves is stripped before decoding.

Why do I get an odd number of digits error?

Every byte needs exactly two hex digits, so valid hex always has an even count. An odd count means a digit was lost in copy-paste — usually at the start or end of the selection.

Can I decode arbitrary binary data with this?

Only if the bytes form valid UTF-8 text. The decoder runs in strict mode, so bytes that are not valid UTF-8 — compressed data, images, random keys — produce an error rather than silently corrupted characters.

Is anything uploaded?

No. TextEncoder and TextDecoder are browser APIs; encoding and decoding never leave this tab.

Related tools

Browse allencoding toolsor thefull tool directory.