Skip to content
Handy Browser Tools

Hex ↔ String Converter

Convert UTF-8 text to a hex byte string and back. Handy for reading revert reasons, bytes32 values and calldata fragments. The 0x prefix is optional in both directions.

Private by default: processing stays on your device
YOUR TEXT OR HEX

Text to convert, or hex (0x…) to decode

Hex, both directions.

Convert text to hex or hex back to text, with optional 0x prefix.

Good to know

Hex decoding accepts 0x prefixes and whitespace. Encoding uses UTF-8 bytes. Everything runs in your browser.

Example

Input

Hello world

Output

0x48656c6c6f20776f726c64
Share this page X LinkedIn Reddit

These buttons share the page link, not your input.

Frequently asked questions

Why do I see an odd-length error when decoding?

Every byte is exactly two hex digits, so a valid hex string always has an even number of digits. An odd length means a digit was dropped somewhere, often a stripped leading zero.

Does it handle emoji and non-English text?

Yes. Text is encoded as UTF-8 before conversion, so multi-byte characters like emoji, accents and CJK scripts round-trip exactly.

How is this different from Base64?

Both represent bytes as text. Hex uses two characters per byte (larger but human-scannable and the convention on EVM chains); Base64 is more compact and common on the web. Use the Base64 tool for the latter.

Is anything sent to a server?

No. Conversion uses the browser's built-in TextEncoder and TextDecoder, so your data never leaves your device.

Keccak-256 Hash

Compute Keccak-256 hashes and Solidity function selectors online.