How to Convert Text to Hex Online (Step by Step)
To convert text to hex, paste your text into a text-to-hex converter and it encodes each character as UTF-8, then writes every byte as a two-digit hexadecimal number from 00 to FF β so the letter "A" becomes 41. You then choose how the bytes are separated and whether the digits are upper or lower case. This guide walks through each step and explains the choices you will make along the way.
The ByteTools Text to Hex Converter runs entirely in your browser and updates live as you type, so nothing you enter is uploaded and you see the result instantly.
Step 1: Enter your text
Type or paste anything into the input box β a word, an API key format, a snippet of code, or a line with accented letters and emoji. The hexadecimal output appears immediately below and refreshes with every keystroke, so there is no convert button to press.
Step 2: Pick a separator
How the bytes are joined together matters, because different tools and languages expect different formats. The converter offers four choices:
| Separator | "Hi" looks like | Typical use |
|---|---|---|
| Space | 48 69 | Readable byte dumps, docs |
| None | 4869 | Compact hash-style strings |
| 0x prefix | 0x48 0x69 | C, Java, JavaScript literals |
| \x prefix | \x48\x69 | Escaped bytes inside strings |
Choose the one that matches wherever you plan to paste the result so you avoid reformatting by hand afterwards.
Step 3: Set the letter case
Toggle uppercase digits on or off. ff and FF represent the same byte, so this is purely about matching the surrounding style β lowercase is common in web and Unix contexts, uppercase often appears in memory dumps and formal documentation.
Step 4: Read and copy the output
With text entered and your format chosen, the hex string is ready below. Copy it to your clipboard in a single click and paste it into your editor, terminal or document. To try a different string, edit the input and the output follows along.
Why UTF-8 encoding comes first
Before any byte becomes hex, each character is encoded as UTF-8. Plain ASCII characters are a single byte, but accented letters and emoji use several, so those produce more than two hex digits. Encoding through UTF-8 guarantees the hex maps to the exact byte sequence a program would store, which means it round-trips cleanly back to the original text. When you need that reverse trip, the companion Hex to Text Converter reads any of these formats and decodes them back.
Try the Text to Hex Converter β free and 100% in your browser.
FAQ
Which separator should I choose if I'm not sure?
Start with a space separator β it is the most readable and easiest to reformat later. Switch to 0x or \x only when you are pasting directly into source code that expects those prefixes.
Do I need to strip spaces before pasting hex into code?
If your target expects continuous hex, choose the "none" separator up front rather than deleting spaces by hand. That gives you a clean, unbroken string ready to paste.
Why is my emoji longer than two hex digits?
Because it is more than one byte in UTF-8. A typical emoji is four bytes, so it shows as four two-digit hex values β that is correct, not a glitch.
Can I convert the hex back into readable text?
Yes. Paste it into the Hex to Text Converter, which accepts spaced, unspaced and prefixed formats and decodes them back to UTF-8 text, completing the round trip.
Related free tools
- Hex to Text Converter β decode hex back into readable text.
- Base64 Encoder β another way to represent bytes as text.
- URL Encoder β percent-encode text for safe URLs.
- XOR Cipher Encoder & Decoder β experiment with byte-level operations.
Built by ByteVancer
ByteTools is a free product of ByteVancer, a software and web development studio building web apps, SaaS and custom software. If you need reliable developer tools or a product built for your users, explore what ByteVancer offers.
Recommended reading
Text to Hex: Practical Use Cases and Examples
Real workflows where converting text to hex helps β debugging, reverse engineering, building code literals, and inspecting encodings, with worked examples.
Text to Hex: Best Practices and Common Pitfalls
Expert tips for text-to-hex conversion β matching separators to your language, case conventions, UTF-8 gotchas, and the mistakes that break round-trips.
XOR Cipher Use Cases: CTFs, Learning, and Puzzles
Real use cases for the XOR cipher, from CTF challenges and teaching bitwise logic to lightweight obfuscation, with concrete worked examples.
XOR Cipher Tips: Keys, Security, and Common Mistakes
Pro tips and common mistakes for the repeating-key XOR cipher: key length, reuse pitfalls, format choices, and when to switch to real encryption.