Hex Encoder

Runs in browser Encoding

Encode text as hex — continuous, space-separated, 0x-prefixed or as a C array — using UTF-8, UTF-16 or Latin-1 encoding.

Privacy: This tool runs entirely in your browser. Your input never leaves your device.
Loading tool…

What are hexadecimal and binary representations?

Binary writes a value in base 2 and hexadecimal in base 16, where one hex digit stands for exactly four bits, so a byte is always two hex characters (0x00–0xFF). Hex is how hashes, colours, memory addresses and raw bytes are usually shown, and Base16 encoding (RFC 4648) is simply hex applied to a byte sequence.

How to use Hex Encoder

  1. Paste the text.
  2. Choose the encoding and the output format.
  3. Set bytes per line for hex-dump style output.
  4. Copy the hex.

Hex Encoder features

  • UTF-8, UTF-16 LE/BE or Latin-1 byte encoding
  • Continuous, space-, colon-, 0x-prefixed, percent-encoded or C array formats
  • Lowercase or uppercase digits; optional bytes-per-line wrapping
  • Warns when Latin-1 cannot represent a character
  • Live output with byte counts

Hex Encoder example

Hex of an emoji in UTF-8

Input:

🚀

Output:

f0 9f 9a 80

Frequently asked questions about Hex Encoder

Why does "é" become two bytes?

In UTF-8, characters outside ASCII take 2–4 bytes (é = C3 A9, 🚀 = F0 9F 9A 80). Choose UTF-16 to see 2-byte code units or Latin-1 for single bytes (only for characters up to U+00FF).

What is the C array format for?

It produces "const unsigned char data[N] = { 0x48, … };" that you can paste straight into C/C++ source for embedded strings and test fixtures.

Uppercase or lowercase?

Both mean the same. Lowercase is conventional in most languages and tools; some specifications (e.g. percent-encoding, MAC addresses) prefer uppercase.

What is UTF-16 LE vs BE?

The byte order of each 16-bit unit. Windows APIs and .NET use little-endian (LE); network protocols and Java often use big-endian (BE). "A" is 41 00 in LE and 00 41 in BE.

Technical notes

Each byte of the encoded text becomes two hexadecimal digits. UTF-8 is variable-length (1–4 bytes per character); UTF-16 uses 2 bytes per code unit with the chosen byte order; Latin-1 uses one byte and replaces unrepresentable characters with "?" (0x3F).

References