Hex Encoder
Convert text into hexadecimal bytes — or hex back into text — with the separator and letter case you need.
● Your data is processed locally in your browser and is never uploaded to our servers.
How to convert text to hex
- Choose the direction: Text → hex or Hex → text.
- Choose the separator: space (
48 65), none (4865), colon (48:65),0xprefix (0x48, 0x65) or\xescapes (\x48\x65). - Choose UPPERCASE or lowercase letters.
- Paste your input and click Convert.
How text becomes hex
Each character is first encoded in UTF-8, then each byte is written as two hex digits. Basic English letters, digits and symbols take one byte; accented letters take two; emoji take four:
| Text | Hex (UTF-8) |
|---|---|
| A | 41 |
| a | 61 |
| Hello | 48 65 6C 6C 6F |
| (space) | 20 |
| (new line) | 0A |
| é | C3 A9 |
| € | E2 82 AC |
| 😀 | F0 9F 98 80 |
Which separator should I use?
- Spaces — readable; used by hex editors and most online tools.
- None — compact; used in hashes, keys, URLs and databases.
- Colons — MAC addresses, certificate fingerprints.
- 0x prefix — byte arrays in C, C#, Java or JavaScript code.
- \x escapes — strings in C, Python, PHP or shell scripts.
Hex to text
Paste hex bytes with or without separators and choose Hex → text. The bytes are decoded as UTF-8. If the result shows strange characters (like é), the original text was probably in another encoding, such as Windows-1252.
In code
Python: "Hello".encode().hex() → '48656c6c6f', and bytes.fromhex("48656c6c6f").decode() → 'Hello'. JavaScript: [...new TextEncoder().encode("Hello")].map(b => b.toString(16).padStart(2, "0")).join(""). Command line: xxd or hexdump -C.
FAQ
Is hex encoding encryption?
No. Hex is just another way to write bytes: anyone can decode it. To protect data, use the AES Encrypt tool.
Hex or Base64?
Hex doubles the size (2 characters per byte) but is easy to read; Base64 is more compact (4 characters per 3 bytes).
How do I see each character's code number?
Use Text to ASCII for decimal codes and Unicode code points, or Text to Binary for bits.