Text to Hex Converter

This text to hex converter shows the UTF-8 bytes of your text in hexadecimal, and turns hex back into text. It works with any language and with emoji, and lets you pick the separator your code needs.

Updated
Runs in your browser. Your text is not uploaded.
Direction
Output

        

How to use the Text to Hex Converter

  1. Choose Text → Hex or Hex → text.
  2. Type or paste your input. Hex can have spaces, commas, 0x, or \x between bytes.
  3. Pick a separator and copy the output.

How it works

The text is encoded as UTF-8, and each byte is written as two hex digits. ASCII characters take one byte; most accented letters take two, most Asian characters three, and emoji four.

H → 0x48, i → 0x69, ! → 0x21
€ → e2 82 ac (three bytes)

Going back, the bytes are decoded strictly: a sequence that isn't valid UTF-8 gives an error instead of a replacement character.

Examples

  • Hi! = 48 69 21.
  • € = e2 82 ac.
  • café = 63 61 66 c3 a9.
  • 48 65 6c 6c 6f = Hello.

Hex and ASCII

For plain English text, UTF-8 and ASCII give the same bytes: A is 41, a is 61, and a space is 20. Differences start with characters outside ASCII. Tools that assume Latin-1 would write é as a single byte e9, while UTF-8 uses c3 a9. This converter always uses UTF-8, the encoding of the web.

Limitations

  • Only UTF-8 is supported, not Latin-1 or UTF-16.
  • Hex must contain whole bytes (an even number of digits).

Frequently asked questions

How do I convert text to hex?

Encode each character as UTF-8 and write every byte as two hex digits. For ASCII, that is the character code in hex: A is 41.

Why does é become two bytes?

In UTF-8, characters beyond ASCII take two to four bytes. é is U+00E9, which UTF-8 writes as c3 a9.

Can I paste hex with 0x prefixes?

Yes. 0x, \x, %, spaces, commas, and colons between bytes are all accepted.

Often used together with the Text to Hex Converter.