Skip to content
toolgrid

No tool found. Try another word.

Text to Hex Converter

Convert text to hexadecimal: every UTF-8 byte as two hex digits, with spaces or not, upper- or lowercase and an optional 0x or \x prefix.

Hex to Text Converter

Runs in your browser. What you enter is kept for 30 days to improve Toolgrid, then deleted.

How to use the Text to Hex Converter

  1. 1 Type or paste your text.
  2. 2 Choose the separator, case and prefix.
  3. 3 Copy the hexadecimal.

About the Text to Hex Converter

This converter shows the bytes of your text in hexadecimal, two digits per byte: "Hi" is 48 69. It is useful for debugging encodings, writing byte strings in code, or comparing data with a hex dump.

Text is encoded as UTF-8, so é becomes c3 a9 and 😀 becomes f0 9f 98 80. A Windows line break shows as 0d 0a. Choose spaces between bytes for readability, or none for a compact string.

Prefixes make the output ready for code: 0x48 0x69 for C-style arrays, or \x48\x69 for string literals in Python, PHP, C and shell. Hex to Text decodes it again.

Frequently asked questions

What is "Hello" in hex?

48 65 6c 6c 6f.

Why does é become two bytes?

In UTF-8, characters outside ASCII take two to four bytes. é is c3 a9.

How do I use it in a string literal?

Choose the \x prefix and no separator: "\x48\x69" works in Python, PHP, C and many other languages.

Is this the same as a hex colour or hex number?

No. This converts characters to bytes. For numbers, use Decimal to Hex.