🔡 Text to Hex Converter
Turn any text into its UTF-8 hex bytes, or paste hex (with or without spaces and 0x) to decode it back to readable text.
13 UTF-8 bytes → hex
How the text to hex converter works
Encoding first converts the text to UTF-8 bytes (so accented letters and emoji become their multi-byte sequences), then writes each byte as two hexadecimal digits, space-separated. Decoding strips out any spaces, 0x prefixes, colons or commas, pairs the remaining hex digits into bytes, and decodes them back as UTF-8, rejecting input that isn’t valid UTF-8 so you know the hex was wrong.
The output is UTF-8, the modern default. A plain ASCII character is one byte (e.g. A = 41), but characters like é or emoji take two to four bytes, so the hex is longer than the character count. For raw byte values in another encoding, this tool assumes UTF-8.
Frequently asked questions
How do I convert text to hex?
Encode the text as UTF-8 bytes and write each byte as two hex digits. "Hi" is 48 69. This tool does it automatically, choose Text → hex and paste your text.
How do I convert hex to text?
Choose Hex → text and paste the hex. Spaces, 0x prefixes and colons are ignored, so "48 69", "4869" and "0x48 0x69" all decode to "Hi". The bytes are read as UTF-8.
Why is the hex longer than my text?
Because non-ASCII characters take more than one byte in UTF-8. A plain letter is one byte (two hex digits), but é is two bytes and most emoji are four, so the hex grows accordingly.
What if decoding fails?
An odd number of hex digits, or bytes that don’t form valid UTF-8, will error. Check that every byte has two digits and that the hex is complete and correct.
Is this the same as ASCII codes?
For plain English text, yes, ASCII characters have the same one-byte hex values in UTF-8 (A = 41, space = 20). They differ only for non-ASCII characters, which UTF-8 encodes as multiple bytes.
Can you show a full worked example?
The word "Hi!" is three ASCII characters: H = 0x48, i = 0x69, ! = 0x21, so the hex is 48 69 21. Add a euro sign € and you gain three more bytes (E2 82 AC), because it sits outside ASCII and UTF-8 needs three bytes to encode it.
Why do I get two hex digits per byte?
One byte holds a value from 0 to 255, which is exactly two hexadecimal digits (00 to FF). So each byte always maps to a two-character hex pair, a leading zero is kept (e.g. a tab, byte 9, is written 09) so the pairing stays unambiguous when you decode.
Is text-to-hex the same as Base16?
Yes, hexadecimal encoding of bytes is exactly Base16. Each byte becomes two hex digits, so the output is twice the byte length (100% overhead). That is bulkier than Base64's ~33%, but hex stays far easier to read and to line up byte-by-byte, which is why hex dumps use it.
Does the output include a 0x prefix?
On encode, no, the tool outputs plain space-separated pairs like 48 69, with no 0x prefixes or colons. On decode it is lenient the other way: 0x prefixes, colons, commas and spaces are all stripped before pairing, so hex copied from many different tools decodes without cleanup.