Text to Hex — UTF-8 Byte Encoder and Decoder

Encode text as hexadecimal UTF-8 bytes or decode valid UTF-8 hex. Supports spaces and per-byte 0x prefixes, with strict byte validation and input limits.

🔒 Local processing
⚡ Free to use
🌐 Runs in your browser
📦 See output options
⚡

Text to Hex — UTF-8 Byte Encoder and Decoder

Tool workspace

Ready

Loading tool...

  1. Enter text, choose spaces or per-byte 0x prefixes, then Convert to Hex.
  2. To reverse, enter complete hexadecimal byte pairs and Convert to Text.
  3. Check the result and copy the required field.
  4. Use Clear to empty both fields.

Convert UTF-8 text and hexadecimal bytes

The encoder turns text into UTF-8 bytes and writes each byte as two lowercase hexadecimal digits. This is reversible encoding for valid Unicode text, not encryption, compression or a cryptographic hash. Anyone with the bytes can decode them.

Examples and input notation

Hello becomes 48656c6c6f. Hi with spacing becomes48 69; with prefixes it becomes0x48 0x69. The prefix option always separates bytes with spaces. Arabic, Chinese and emoji usually require more bytes than visible characters, so a character is not necessarily one hex pair.

The decoder accepts uppercase or lowercase hex, whitespace between byte groups and optional0x prefixes at token boundaries. It requires complete byte pairs and valid UTF-8. Odd digits, non-hex symbols and invalid byte sequences are rejected. It does not decode arbitrary binary files or other text encodings such as UTF-16 or Windows-1252.

Limits and exactness

Text input is limited to200,000UTF-16 code units and hex input to3,000,000characters including formatting. Limits protect browser responsiveness but do not guarantee a particular processing time. A failed conversion clears the destination field so a previous result is not mistaken for the new one.

Newlines, spaces, null characters and an initial Unicode BOM are retained by the tested round trips. The browser encoder replaces isolated UTF-16 surrogates with a replacement character, so malformed JavaScript strings are not losslessly round-tripped. No Unicode normalization is applied.

Copy and privacy

Copy controls copy the selected field as plain text and report clipboard failure. If blocked, select and copy manually. The converter has no tool-specific network dependency or file upload; loading the site still involves network requests. It has no file import, binary download, encryption key or encoding selector.

Frequently asked questions

Is hex encryption?

No. It is a readable representation of bytes and has no secret key.

Why does an emoji use several byte pairs?

UTF-8 encodes many characters with multiple bytes.

Can any hex file become text?

No. These bytes must form valid UTF-8 text.