Text to Hex

Convert text to hexadecimal bytes (UTF-8)

Convert text - including emoji and accented letters - to hexadecimal bytes using UTF-8, with your choice of separator, 0x, \x or % prefix and letter case, plus a character-by-character table.
Try an example:

Output will appear here...

About Text to Hex

How it works

  1. Each character is encoded as UTF-8 bytes: 1 byte for English letters, digits and punctuation, 2-4 bytes for accented letters, other alphabets and emoji.
  2. Each byte (0-255) is written as two hexadecimal digits, 00 to FF. "H" is 72 in decimal, which is 48 in hex.
  3. The table shows every character with its Unicode code point and its bytes in hex and binary.

What you need

  • Any text.

Tips

  • Choose the \x prefix for strings in C, Python or JavaScript ("\x48\x69"), and 0x for arrays of byte values.
  • The % prefix gives URL percent-encoding of every byte.
  • Compare the output with what you see in a hex editor or network capture.

Runs in your browser. Everything happens in your browser - the text you enter is never uploaded.

Frequently asked questions

How do I convert text to hex?+

Each character is turned into its byte value(s) in UTF-8, and each byte is written as two hex digits. "Hi" becomes 48 69. Type your text here and the hex appears instantly.

Why does one character give several hex bytes?+

Characters outside basic English need more than one byte in UTF-8: "é" is C3 A9 and an emoji such as 👍 is F0 9F 91 8D.

Is text to hex the same as ASCII to hex?+

For plain English text, yes - UTF-8 matches ASCII for the first 128 characters. They differ only for accented letters, other scripts and emoji.