ToolMill.io

Hex Encode / Decode — Text ↔ Hex

Hex Encode / Decode converts text into hexadecimal (base-16) bytes and decodes hex back into readable text. Use it for debugging binary payloads, inspecting UTF-8 bytes, reversing escaped strings, and working with hashes or low-level protocols. Accepts common hex formats (with or without spaces, newlines, or 0x prefixes). Runs 100% locally in your browser — no uploads — and works offline after installing ToolMill as a PWA.

Encoding

Try it

Examples

Encode text to hex
Input
Hello, ToolMill!
Output
48656c6c6f2c20546f6f6c4d696c6c21
Decode hex to text
Input
54686973206973206120686578206465636f646520746573742e
Output
This is a hex decode test.
Decode spaced hex bytes
Input
48 65 6c 6c 6f 20 54 6f 6f 6c 4d 69 6c 6c
Output
Hello ToolMill

What hex encoding means

Hex is a base-16 representation of byte values. Each byte is normally written as two hex characters, which is why simple text expands into a longer sequence when you encode it here. This makes hex useful when you want to inspect byte-level values in a readable, copyable form.

When to encode text to hex

Encoding text to hex is useful when you want to see exactly which bytes a string produces, compare copied payloads, document protocol samples, or inspect non-printable characters indirectly. This is often easier than guessing what a terminal, API log, or debugger is showing.

When to decode hex back to text

Decoding is helpful when a tool, log, or copied dump gives you byte values instead of readable characters. A successful decode only guarantees that the bytes can be interpreted as text here. Some valid hex still represents binary data or control characters, so readable output is not always the expected result.

Input rules and common errors

Valid hex uses the characters 0-9 and A-F, and uppercase or lowercase both work. This tool removes spaces and line breaks before decoding, but an odd number of hex characters or any invalid character will still fail. If you pasted prefixes such as 0x, punctuation from logs, or separators from a copied dump, clean those parts first.

Text encoding notes

When you encode text, the page first turns that text into bytes and then represents those bytes in hex. That matters for symbols, emoji, and non-Latin characters because one visible character can use multiple bytes. This is also why two systems can appear to disagree when they use different text encodings.

Hex is not encryption

Before You Rely on Hex-Converted Values in Logs, APIs, or Scripts

Before copying the result into another system, check whether the destination expects plain hex, spaced bytes, uppercase or lowercase characters, or prefixed forms such as 0x. Small formatting assumptions often matter even when the underlying bytes are technically the same.

What Hex Encode/Decode Does Not Confirm About the Underlying Data

Hex conversion does not tell you whether the bytes came from plain text, binary data, compressed content, or an application-specific format. It only changes representation. You still need to know what the bytes are supposed to mean before trusting the output for debugging or reuse.

How to Tell Whether Decoded Hex Output Looks Correct

Decoded hex output may look correct only if the original bytes actually represented text in the character encoding you expect. If the result contains odd symbols, replacement characters, or unreadable text, the hex may still be valid while the assumed text encoding is wrong for your workflow.

Hex changes how bytes are displayed, not who can read them. If the original bytes represent readable text, anyone can convert them back easily. Use this tool for inspection, debugging, and conversion workflows, not for protecting secrets.

Related tools