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:
| Input | Output |
|---|---|
| Hello | 48 65 6c 6c 6f |
| Hi! ₹5 | 48 69 21 20 20b9 35 |
| a, line break, b, tab, c | 61 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 bee2 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 bec3 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:
a0is a non-breaking space, common in text pasted from web pages and Word files, and it breaks exact-match searches and formulas.200bis a zero-width space, which can make two identical-looking usernames or coupon codes different.feffat the very start is a byte order mark, a stray marker some editors add to the top of a file.09is a tab and0aa 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.