Text to Hex Encoder

Convert text to hexadecimal UTF-8 bytes. Choose lowercase or uppercase and a separator: none, space, colon, 0x prefix or \x escapes. Runs locally.

24 characters · 28 bytes (UTF-8)

0 characters · 0 bytes (UTF-8)

Runs entirely in your browser. Your data is never uploaded.

What is Hex Encode?

Shows the bytes of your text in hexadecimal (Base16, RFC 4648). The text is encoded as UTF-8, so é becomes c3 a9 and an emoji takes four bytes. You can format the output for code, logs or byte dumps.

How to use Hex Encode

  1. Type or paste text into Input.
  2. Choose Letter case and a Byte separator (none, space, colon, 0x prefix or \x prefix).
  3. Copy the hex from Output.

Example

Input
Hi 😀
Output
486920f09f9880

When to use Hex Encode

Use hex to inspect exactly which bytes a string contains, to write byte literals in source code (\x.., 0x..) or to compare encodings. For compact transport use Base64 instead; hex doubles the size.

How Hex Encode works

Each character is converted to its UTF-8 byte sequence with TextEncoder; every byte (0–255) is written as two hex digits. Separators are only formatting – the bytes are the same.

Common Use Cases

  • Spotting hidden characters such as non-breaking spaces or BOMs
  • Writing C/Python byte string literals
  • Preparing hex keys or payloads for tests
  • Explaining how UTF-8 encodes accented letters and emoji

FAQs

Why does one emoji give 8 hex digits?

Emoji outside the Basic Multilingual Plane take 4 bytes in UTF-8, and each byte is two hex digits.

Is this the same as converting a number to hex?

No. This encodes text bytes. To convert a number like 255 to ff, use a number base converter.

Which character set is used?

UTF-8, the encoding used on the web.

Explore more categories