How to use the Hex Decoder
Decode hex to text in two steps:
1
Paste your hex string
Enter the hex string in any format — plain (48656c6c6f), space-separated (48 65 6c), 0x-prefixed, \x-prefixed, or percent-encoded. Prefixes are stripped automatically.
2
Read the decoded text
The decoder interprets the bytes as UTF-8 and displays the original text. If UTF-8 decoding fails, it falls back to latin-1. Specific error messages identify malformed input.
When to use this tool
Use this tool when you need to read hex-encoded data as text:
- →Decoding hex strings from Python bytes literals, C hex arrays, or database hex column values back to readable text
- →Reading URL percent-encoded strings found in server logs, analytics reports, or API request traces
- →Decoding hex output from debugging tools, hex editors, or network packet captures
- →Reverse-engineering obfuscated strings encoded as hex in JavaScript bundles or mobile app disassembly
- →Decoding hex-encoded message payloads from IoT device logs or embedded system serial output
- →Converting hex representations from Solidity/EVM call data or transaction input fields back to readable strings
Frequently asked questions
Q:What hex prefixes does this tool automatically strip?
The decoder automatically removes three common hex prefix styles before parsing: (1) 0x prefix — used in C, JavaScript, Solidity, and SQL (0x48 → 48); (2) \x prefix — used in Python bytes, C strings, and regex patterns (\x48 → 48); (3) % prefix — used in URL percent-encoding (%48 → 48). All three are stripped globally before the hex digits are parsed, so you can paste hex from any source without manually reformatting it. Spaces and newlines between byte pairs are also ignored.
Q:Why does decoding fail when I have an odd number of hex digits?
Each hex byte requires exactly two hex digits — one nibble (4 bits) for the upper half and one for the lower half of the byte. An odd number of hex digits means the last byte is incomplete and cannot be decoded to a valid byte value. For example, '4' alone doesn't define a byte — it could be 0x40 through 0x4F. The correct approach is to pad single digits with a leading zero: '4' → '04'. If you see this error, check whether your source dropped a leading zero — 0x04 often appears as just 4 in some representations.
Q:What is the difference between hex decoding and URL decoding?
URL decoding (percent-decoding) specifically handles % sequences in URL strings and converts + to space in form-encoded contexts. This hex decoder handles the % format as one of several input styles, but is a general-purpose byte-to-text converter. For full URL decoding including query string parameters, use a dedicated URL Decoder tool that handles edge cases like + signs for spaces, multiple encoding passes, and partial encoding. This tool is best for decoding raw hex byte sequences; the URL Decoder is better for browser URL strings and query parameters.
Q:What encoding does the decoder use to interpret the bytes?
The decoder first attempts UTF-8 decoding using the browser's TextDecoder API with fatal: true — this rejects sequences that are not valid UTF-8, ensuring correct handling of multi-byte characters. If UTF-8 decoding fails (the bytes don't form valid UTF-8 sequences), it falls back to latin-1 (ISO-8859-1), interpreting each byte as its corresponding latin-1 character. This fallback handles hex dumps of legacy ISO-8859-1 encoded text. There is no auto-detection of Windows-1252, Shift-JIS, or other encodings — for those, you'd need a dedicated character encoding tool.
Q:Why does my decoded output contain garbled characters or replacement symbols?
Garbled output typically has one of three causes: (1) the hex bytes represent text in a different encoding than UTF-8 (like Windows-1252 or Shift-JIS) — the decoder interprets them as UTF-8/latin-1, producing incorrect characters; (2) the hex is not text at all but binary data (image bytes, compressed data, executable code) — binary data decoded as text will always produce garbage; (3) the hex contains a BOM (Byte Order Mark) at the start (EF BB BF for UTF-8) which may add an invisible character. For non-text binary hex, use a hex viewer or binary analysis tool rather than a text decoder.
Q:How do I decode a hex-encoded Ethereum transaction input field?
Ethereum transaction input data is ABI-encoded, not plain text hex. The first 4 bytes (8 hex chars) are the function selector. The remaining bytes are ABI-encoded parameters. Decoding it with a plain text converter will produce garbage. To properly decode Ethereum calldata, use a Solidity ABI decoder with the contract's ABI definition. However, this tool is useful for decoding Ethereum string parameters that are ABI-encoded — strings in ABI encoding are stored as UTF-8 bytes with an offset and length prefix, and the string bytes themselves decode correctly with this tool after extracting the relevant portion.