EthicalFusion

Text to Hex Converter

Convert text into hexadecimal byte values.

Was this tool helpful?

Thanks for the feedback!

This text to hex converter shows the hexadecimal code of every character you type, separated by spaces, so you can see exactly what a piece of text contains. It is useful for spotting invisible characters, checking what a program will receive, and learning how character codes work.

What the output means

Each character is replaced by its code in base 16, written in lower case and padded to at least two digits. For plain English letters, digits and common punctuation these are the familiar ASCII values, which are also the UTF-8 byte values:

InputOutput
Hello48 65 6c 6c 6f
Hi! ₹548 69 21 20 20b9 35
a, line break, b, tab, c61 0a 62 09 63

In the first row 48 is H, 65 is e and 6c is l. In the second, 21 is the exclamation mark, 20 the space and 20b9 the rupee sign.

Characters beyond ASCII: code units, not UTF-8 bytes

The conversion reads text the way JavaScript stores it, as UTF-16 code units. That matters outside the basic ASCII range:

  • Characters from U+0100 upwards appear as four hex digits, so the rupee sign ₹ is 20b9. Its UTF-8 bytes would be e2 82 b9.
  • Characters between U+0080 and U+00FF, such as é, appear as two digits (e9), which is the Latin-1 value; the UTF-8 encoding would be c3 a9.
  • Emoji and other characters above U+FFFF are split into a surrogate pair: 😀 gives d83d de00.

So if you need the byte sequence that a UTF-8 file or network packet would contain, this output only matches for plain ASCII text. Keep that in mind when comparing it with a hex editor, which shows the file's actual bytes.

A quick way to read hex

Each hex digit stands for four bits, so two digits cover one byte and range from 00 to ff (0 to 255). Capital letters A to Z run from 41 to 5a and small letters from 61 to 7a, exactly 20 apart in hex (32 in decimal), which is why changing the case of a letter only flips one bit. The digits 0 to 9 are 30 to 39.

Finding hidden characters

Copied text often carries characters you cannot see, and converting a suspicious word reveals them at once:

  • a0 is a non-breaking space, common in text pasted from web pages and Word files, and it breaks exact-match searches and formulas.
  • 200b is a zero-width space, which can make two identical-looking usernames or coupon codes different.
  • feff at the very start is a byte order mark, a stray marker some editors add to the top of a file.
  • 09 is a tab and 0a a line break.

Converting back and related formats

The Hex to Text Converter reads hex in pairs of digits, so ASCII output from this page round-trips perfectly. Four-digit codes such as 20b9 will not, because they get read as two separate two-digit values. To see the same characters in other number systems, try Text to Binary or Text to ASCII Codes.

Frequently asked questions

Why does ₹ show as 20b9 instead of e2 82 b9?
The output is each character's UTF-16 code unit, and the rupee sign is U+20B9. The three-byte sequence e2 82 b9 is its UTF-8 encoding, which this converter does not produce.
Is the hex output uppercase or lowercase?
Lowercase, with a single space between characters. Most programs accept either case, so a quick find and replace will do if a system insists on capitals.
Why does an emoji produce two codes?
Emoji sit above U+FFFF, and JavaScript stores such characters as two 16-bit surrogate halves, so both halves are shown.
How do I add a 0x prefix for use in code?
The output has no prefixes. In your editor, replace each space with a comma, space and 0x, then add 0x before the first value.
Can it reveal hidden spaces in my text?
Yes. A normal space shows as 20, a non-breaking space as a0 and a zero-width space as 200b, which makes invisible differences obvious.

Related tools

Embed this tool on your site

Paste it into any blog or website. Free, with a credit link.