Developer tools

Text to Hex

Text to Hex Converter

Convert text to hexadecimal UTF-8 bytes or code points, and hex back to text.

About this tool

About Text to Hex

See exactly which bytes make up a piece of text. The converter encodes text as UTF-8 and writes each byte as two hexadecimal digits, so A is 41, é is C3 A9 and an emoji takes four bytes. Switch Values are to Code points to get the Unicode number of each character instead, such as 00E9 for é and 1F600 for the grinning face. Format the output the way your code or protocol expects: separate values with spaces, commas or new lines, or run them together; add a 0x prefix; choose upper or lower case; keep leading zeros. Going the other way, paste hex in almost any shape, including 48 65 6C, 48656C, 0x48,0x65, \x48\x65, 48:65 or %48%65, and the separators and prefixes are recognised automatically. Odd digit counts and invalid characters are reported precisely. It is handy for debugging encodings, reading packet dumps and writing byte arrays, and it runs entirely in your browser.

Built and maintained by Abhi JainUpdated

How to Convert Text to Hex

  1. 1

    Choose the direction

    Pick Text → Hex, or Hex → Text to decode.

  2. 2

    Pick the values

    Choose UTF-8 bytes or Code points, then the Separator and whether to pad, add a 0x prefix or use Uppercase.

  3. 3

    Type and copy

    Type or paste your text, then copy or download the hex. Click Swap to decode it back and check it.

Text to Hex: questions and answers

How do you convert text to hex?

Encode the text as bytes (UTF-8 on the web) and write each byte as a base-16 number from 00 to FF. For example 'Hi' is the bytes 72 and 105, which are 48 69 in hex.

Why does é become C3 A9 and not E9?

E9 is é's Unicode code point. In UTF-8, code points above 127 take two to four bytes, and é is stored as C3 A9. Choose Code points to see E9.

Is text to hex the same as ASCII to hex?

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

Can I convert hex without spaces back to text?

Yes. A run like 48656C6C6F is split into pairs of digits automatically. With spaces, commas, colons or 0x prefixes it works too.

Ready-made Text to Hex presets