Advertisement

Hex Encoder (Text to Hex)

Convert text to hexadecimal bytes in UTF-8, UTF-16 or Latin-1, as plain hex, spaced, colon, 0x, \x or %XX escapes, with a byte table for each character.

Hex encoding writes every byte as two digits from 00 to FF, which makes invisible characters, character encodings and byte order easy to see. This encoder turns text into hex using UTF-8 (the web standard), UTF-16 or Latin-1, in the layout your code or tool expects — plain, spaced, colon-separated, 0x-prefixed, \x escapes or URL percent escapes — and lists the bytes behind every character.

How to use this tool

  1. Type or paste the text.
  2. Pick the character encoding; UTF-8 is right unless a system asks for something else.
  3. Choose the output format and letter case.
  4. Copy the hex, or check the table to see which bytes each character produced.

Formula

byte = 16 × (first hex digit) + (second hex digit)

Text is first turned into bytes by the chosen encoding, then each byte (0–255) is written as two hex digits, 0–9 and a–f. In UTF-8, ASCII characters take one byte, accented Latin, Greek and Cyrillic letters two, other characters such as €, Chinese or Korean three, and supplementary code points four; an emoji sequence may contain several code points.

Example

"Hello" is H = 72 = 4 × 16 + 8 → 48, e = 101 → 65, l = 108 → 6c (twice) and o = 111 → 6f, so the output is 48 65 6c 6c 6f. The euro sign € (U+20AC) needs three UTF-8 bytes, e2 82 ac, but two in UTF-16 (20 ac big-endian, ac 20 little-endian), and it cannot be written in Latin-1 at all.

Frequently asked questions

Why does one character give several bytes?

UTF-8 is a variable-length encoding: it uses 1 byte for ASCII and up to 4 for other characters. The table shows exactly how many bytes each character took.

What is the difference between UTF-16 BE and LE?

Both store each code unit in two bytes; big-endian puts the high byte first, little-endian the low byte first. Windows and most CPUs use little-endian internally, while many file formats and network protocols use big-endian.

Which format should I use in code?

Use 0x48, 0x65 for byte arrays in C, C++, Java or C#, and \x48\x65 inside C strings, Python bytes literals or shell printf. Use %48%65 only for URLs.

Is hex encoding the same as encryption?

No. Hex is a direct, reversible way of writing bytes; anyone can read it with a hex decoder.

Sources

Last updated: 2026-10-30

Advertisement