Text to Hex Converter

Encode Unicode text as UTF-8 bytes and format the hexadecimal output. Processing stays in your browser.
Client-Side Only No Rate Limits No Signup Required

Maximum encoded size: 1,000,000 UTF-8 bytes.

0 characters · 0 bytes
0 hex bytes
Try:

Character Breakdown

Enter text above to see the per-character hex breakdown.

How Text to Hex Conversion Works

Converting text to hexadecimal means encoding characters as bytes and expressing each byte in base-16. This tool uses UTF-8, so it handles valid Unicode text rather than only basic English characters.

For standard ASCII characters (letters A–Z, digits 0–9, common punctuation), each character maps to a single byte. For example, "A" is decimal 65 = hex 41. For characters beyond ASCII — like "é", "ñ", or "中" — UTF-8 uses 2–4 bytes per character.

Common Use Cases

  • Encoding strings for network protocols
  • Preparing hex payloads for APIs
  • Debugging character encoding issues
  • Working with binary file formats
  • Generating hex escape sequences

Quick Reference

  • A–Z: 41–5A
  • a–z: 61–7A
  • 0–9: 30–39
  • Space: 20
  • Newline: 0A

Text to Hex vs ASCII to Hex

"Text to hex" and "ASCII to hex" perform the same operation for standard English characters — both convert each character to its hexadecimal byte value. The key difference is in how they handle characters beyond the basic ASCII range (codes 0–127).

Text to hex typically implies UTF-8 encoding, which represents Unicode scalar values and supports accented letters, CJK characters, emoji, mathematical symbols, and many modern and historic scripts. ASCII to hex is limited to the 128 characters defined in the original ASCII standard.

This converter encodes valid Unicode text as UTF-8. The ASCII to hex programming guide provides Python, JavaScript, C, and shell implementations. To convert in the reverse direction, use the Hex Decoder. For individual character code lookups, use the ASCII Code Converter.

Frequently Asked Questions

How do I convert text to hexadecimal?
Paste or type your text into the input field above. Each character is instantly converted to its hexadecimal byte value. For example, "Hello" becomes "48 65 6C 6C 6F". The conversion runs entirely in your browser — no data leaves your device.
What is the difference between text to hex and ASCII to hex?
For standard ASCII characters (letters, digits, punctuation), the result is identical — both produce the same hex bytes. The difference appears beyond ASCII: text-to-hex commonly uses UTF-8, which represents Unicode scalar values across many scripts, symbols, and emoji. ASCII is limited to 128 characters (codes 0–127).
Can I convert text with special characters to hex?
Yes. The tool encodes valid Unicode text as UTF-8, including accented letters, CJK characters, emoji, and symbols. Multi-byte characters produce multiple hex pairs. For example, "é" becomes "C3 A9" (two bytes in UTF-8).
What hex output formats are available?
You can choose from: space-separated (48 65 6C), continuous (48656C), colon-separated (48:65:6C), or 0x-prefixed (0x48 0x65 0x6C). You can also toggle between uppercase and lowercase hex digits. All formats represent the same underlying data.
How to convert text to hex in Python?
Use: "Hello".encode("utf-8").hex() which returns "48656c6c6f". For space-separated output: " ".join(f"{b:02x}" for b in "Hello".encode("utf-8")). In JavaScript: Array.from(new TextEncoder().encode("Hello")).map(b => b.toString(16).padStart(2, "0")).join(" ").
Is there a limit on text length?
Yes. Input is limited to 1,000,000 UTF-8 bytes to keep the page responsive and avoid excessive browser memory use. Multi-byte characters count by their encoded byte length. Split larger data into smaller chunks or use a streaming command-line tool.