How to use the text to hex converter
- Choose Text → hex or Hex → text.
- Type or paste into Your text.
- For text to hex, pick a Format:
48 65 6c,48656c,48:65:6c,0x48 0x65,\x48\x65or%48%65 (URL). Tick Uppercase for A–F instead of a–f. - Copy the Result.
What it does and when to use it
Hexadecimal is the usual way to show raw bytes, because each byte is always exactly two digits from 00 to ff. This tool turns text into those bytes and back. Developers use it to:
- Write a string as a byte array or escape sequence for C, Python, JavaScript or shell scripts.
- Check what a value really contains when an invisible character or the wrong encoding causes a bug.
- Compare bytes with a protocol trace, a database dump or a debugger.
- Decode hex found in logs, URLs or config files back to text.
For a full byte view with offsets and a character column, use the hex dump viewer. If your hex came from a Base64 value, the Base64 to hex converter goes straight between the two. To look up one character’s code point and bytes, use the Unicode character lookup.
How it works
Text → hex: the text is encoded as UTF-8, and each byte is written as two hex digits. Then the format is applied:
| Format | “Hi” becomes |
|---|---|
| 48 65 6c | 48 69 |
| 48656c | 4869 |
| 48:65:6c | 48:69 |
| 0x48 0x65 | 0x48 0x69 |
| \x48\x65 | \x48\x69 |
| %48%65 (URL) | %48%69 |
Hex → text: 0x, \x and % prefixes and separators are removed, the digits are checked, and each pair becomes a byte. The bytes must be valid UTF-8, otherwise you get an error rather than garbled text. This is the Base16 idea from RFC 4648, applied to UTF-8 text. It runs in your browser.
Worked examples
Hello → 48 65 6c 6c 6f
€ (\x escape) → \xe2\x82\xac
café (%XX URL) → %63%61%66%C3%A9
0x48 0x69 → Hi (Hex → text)
48 6 → Hex needs two digits per byte; the input has an odd number of digits.
The euro sign is three bytes in UTF-8, so it needs three escapes. In the URL format, the é in café becomes %C3%A9, which is exactly what a browser sends for it.
Limits and tips
- Hex doubles the size of the data: every byte becomes two characters, plus any separators.
- The decoder needs UTF-8. Hex of Latin-1 or UTF-16 text will be rejected; the hex dump viewer can still show those bytes.
- An odd number of digits usually means one digit was lost when copying. Check the start and end of your hex.
Frequently asked questions
Why does one character give more than two hex digits?
Which hex formats can I paste to decode?
Why do I get "These bytes are not valid UTF-8 text"?
Is hex a form of encryption?
Should I use upper or lower case?
Sources
- RFC 4648: The Base16, Base32, and Base64 Data Encodings (section 8, Base16) — IETF / RFC Editor, accessed 2026-10-08
How do we know nothing is uploaded? Test it yourself on the privacy proof page.