Hex to Text
Convert between text and hexadecimal
About Hex to Text
Hex to Text converts between text and its UTF-8 bytes written in hexadecimal, using your browser's own text encoder. Text to Hex writes each byte as two lowercase digits separated by spaces, so é gives c3 a9, ☕ three bytes, and 😀 four. Hex to Text reads digit pairs with or without separators (spaces, commas, colons, semicolons, hyphens) and accepts the 0x48 and \x48 notations. It refuses an odd number of digits, characters that are not hex, and bytes that are not valid UTF-8, instead of printing garbage. Latin-1, UTF-16, and other encodings are not decoded.
Example
A short text with an accent and an emoji turned into bytes, then C-style hex bytes turned back into text:
Input
Hi é😀 0x48,0x69,0x20,0xc3,0xa9
Result
Text to Hex: 48 69 20 c3 a9 f0 9f 98 80 Hex to Text: Hi é
How to convert hex to text
- 1Paste hex bytes, or the text you want to see as hex.
- 2Click "Hex to Text" to decode the bytes as UTF-8, or "Text to Hex" to get space-separated byte pairs.
- 3If the result box shows a message instead, it names the problem: an odd number of digits, a character that is not hex, or bytes that are not UTF-8.
- 4Take the bytes or the text with "Copy", or save them in converted.txt through "Download".
Formats and limits
- Hex input
- Pairs of 0-9 and a-f in either case; spaces, commas, colons, semicolons, and hyphens ignored; 0x48 and \x48 forms accepted
- Hex output
- Lowercase byte pairs separated by single spaces
- Text encoding
- UTF-8 only, in both directions
Where your text is processed
Both directions use your browser's TextEncoder and TextDecoder inside this page, so neither the hex nor the text leaves your computer. When the tool shows an error, such as an odd number of digits, or the browser refuses a copy, we receive that message, the tool's name, and your browser's name and version, without what you pasted.
Frequently asked questions
Is é written as two bytes?
Yes: c3 a9, because the tool writes UTF-8 bytes. e9 is the Latin-1 code for é; pasting e9 alone into Hex to Text gives an error, since that single byte is not valid UTF-8.
What hex formats can I paste?
Any pairs of hex digits: 48656c6c6f, 48 65 6c 6c 6f, 48:65:6c, 0x48,0x65, or \x48\x65. Upper and lower case both work, and separators are removed before decoding, so mixing them is fine.
Can it decode Latin-1 or Windows-1252 bytes?
No. The tool decodes UTF-8 only. Bytes saved in another encoding, or binary data, get the message that they are not valid UTF-8 text, rather than wrong characters.
How many bytes does one character take?
One to four in UTF-8: plain Latin letters one, most accented Latin letters two, ☕ and most Chinese and Japanese characters three, and emoji such as 😀 four (f0 9f 98 80).
Tips and tricks
- ✓To see the \uXXXX escapes a JavaScript string uses instead of bytes, try Unicode Converter.