Text to Hex & Hex to Text

Convert text to hex bytes, escapes or code points, and hex back to text, with a table of every character's code point and UTF-8 bytes.

Runs in your browser. Nothing is uploaded.

Character details

How to use the Text to Hex & Hex to Text

  1. Choose Text to hex or Hex to text, then type or paste into the left box, or press Load example.
  2. Choose a format, such as bytes with spaces, plain hex, \x escapes, % escapes or Unicode code points.
  3. The hex appears on the right as you type.
  4. Open Character details for a table with each character's code point, UTF-8 bytes, HTML and JavaScript escapes.
  5. Use it to find hidden characters such as zero-width or non-breaking spaces.

See the bytes behind your text

Text that looks identical can be different underneath. Two names that won’t match in a database, a password that’s rejected, or a CSV column that won’t sort are often caused by characters you can’t see, such as a non-breaking space, a zero-width space or an accent stored two different ways. Converting text to hex shows exactly which bytes are there.

Formats

  • Bytes with spaces, like 48 65 6C 6C 6F, the common form in documentation and hex editors
  • Bytes, no spaces, like 48656c6c6f, for compact storage and APIs
  • Escaped, like \x48\x65, for Python, C and shell scripts
  • Percent, like %48%65, the same bytes as in URL encoding
  • Unicode code points, like U+0048 U+0065, to identify each character

All byte formats use UTF-8, the encoding of the web and of almost every modern file.

Character details

The Character details table lists every character with its code point, UTF-8 bytes, HTML entity, JavaScript/JSON escape and type (letter, number, space, punctuation, emoji, or control/format character). It’s the quickest way to spot a zero-width space hiding in a product code, or to find the escape you need for a special character in source code.

Hex to text

Switch to Hex to text to decode bytes from logs, packet dumps or escaped strings. Spaced or unbroken hex, 0x prefixes, \x and % escapes and U+ code points are all accepted. The bytes are read as UTF-8, and if they aren’t valid UTF-8 the tool says so and shows the replacement character where a byte didn’t fit. The character table lists every decoded character with its code point, so invisible characters stand out.

Going the other way

To turn hex back into text, switch to Hex to text. For binary, decimal or octal bytes, see Text to Binary. Everything happens on your device.

Frequently asked questions

Why do some characters produce several bytes?

Text is encoded as UTF-8. ASCII letters and digits take one byte each, accented letters two, most other scripts three, and emoji four. So "é" is C3 A9 and "👋" is F0 9F 91 8B.

What's the difference between bytes and code points?

A code point is the character's number in Unicode, such as U+00E9 for é. Bytes are how that number is stored in UTF-8. Choose code points to identify characters, and bytes to see what's actually in a file or network message.

How do I find invisible characters?

Paste the text and open Character details. Zero-width spaces (U+200B), non-breaking spaces (U+00A0) and other invisible characters appear clearly in the table, even though you can't see them in the text.

Which escape format should I use?

\x escapes work in Python byte strings, C and many shells. % escapes are URL encoding. Plain or spaced hex suits hex editors, logs and protocol documentation.

Is my text uploaded?

No. Conversion happens in your browser.

Tutorials