← All tools
// Encode

Text ↔ Hex online

Convert text to hexadecimal encoding and back

Text to Hex Converter logo
by
CHUNKY
MUNSTER
// Output

How to Use the Text to Hex Converter

  1. Paste or enter your input into the text field.
  2. Configure any options (format, delimiter, encoding, or mode) using the controls above the output.
  3. The result updates instantly — no submit button required for most operations.
  4. Click Copy or Download to take the output to your next step.

Paste your text — the tool encodes it to UTF-8 via TextEncoder, then formats each byte as two hex digits. ASCII characters give one byte (two hex chars); accented letters, CJK and emoji give 2–4 bytes each. Output style is configurable: lowercase or uppercase, with or without space separators, and with an optional 0x prefix per byte.

How the Text to Hex Converter Works

Decoder mode strips whitespace and 0x prefixes, then reads pairs of hex digits as bytes and decodes the resulting UTF-8. Malformed UTF-8 sequences produce the Unicode replacement character (U+FFFD) rather than throwing. Useful for hex dumps, embedded firmware strings, JSON \u escapes, and inspecting raw byte values in debug output.

Frequently Asked Questions

Is the hex lowercase or uppercase?

Configurable. Lowercase (ff) is the convention in most modern languages and JSON \u escapes; uppercase (FF) is more common in older C and assembly tooling.

Can I decode hex with or without spaces?

Both. The decoder strips whitespace and 0x prefixes before reading byte pairs, so 'ff a3 0x4c' and 'ffa34c' both decode identically.

What encoding is assumed?

UTF-8. Pasting an emoji like 🎉 gives F0 9F 8E 89 — four bytes — rather than the UTF-16 surrogate pair.

What if the hex string has an odd number of digits?

The trailing nibble is ignored and a warning shown. Each byte requires exactly two hex digits.

Explore the full suite of Encode tools and 290+ other free utilities at Chunky Munster.