Hex Encoder & Decoder Online

Local only

Encode UTF-8 text as hexadecimal bytes or decode hexadecimal bytes back to UTF-8 text.

11 chars · 1 line

22 chars · 1 line

Encoding UTF-8 text as hexadecimal bytes

Hex encoding guide

How to convert between text and hex bytes

Encode readable UTF-8 text into hexadecimal byte pairs or decode hexadecimal bytes back into UTF-8 text. The conversion runs locally in your browser and accepts either compact hex or byte pairs separated by whitespace. This tool is free to use. No account or payment is required.

Last updated

What you can do here

  • UTF-8 text to hexadecimal encoding
  • Compact hexadecimal decoding
  • Whitespace-separated byte decoding
  • Strict hexadecimal and UTF-8 validation
  • Browser-local processing

Steps

  1. Choose Text → Hex to encode text or Hex → Text to decode bytes.
  2. Paste readable text, compact hexadecimal digits, or whitespace-separated hex byte pairs.
  3. Review any validation error for invalid digits, incomplete bytes, or byte sequences that are not valid UTF-8.
  4. Copy or download the converted result.

Hex represents bytes with two digits each

Hexadecimal uses the digits 0-9 and A-F to represent byte values. Each UTF-8 byte becomes exactly two hexadecimal digits, so ASCII text such as hello becomes 68656c6c6f.

Non-ASCII characters can use multiple UTF-8 bytes. Encoding and decoding therefore happens at the byte level rather than by simply replacing one character with one hex number.

Decode compact or spaced hexadecimal safely

Decode mode ignores whitespace so values such as 48 65 6c 6c 6f and 48656c6c6f produce the same text. Other separators are rejected instead of being silently discarded.

The input must contain an even number of hexadecimal digits because every byte needs two digits. Decoded bytes must also form valid UTF-8 text; arbitrary binary data is not rendered as replacement characters.

Hex is representation, not protection

Like Base64, hexadecimal is reversible representation rather than encryption. It is useful for inspecting protocol bytes, hashes, identifiers, fixtures, and encoded text, but it does not provide confidentiality or authenticity.

UTF-8 text to hex example

The UTF-8 bytes for hello world are rendered as lowercase hexadecimal pairs.

Text input

hello world

Hex output

68656c6c6f20776f726c64

Common questions

Frequently asked questions

Can I decode hex values separated by spaces or new lines?

Yes. Decode mode ignores whitespace between hexadecimal digits, so compact and whitespace-separated byte strings are both supported.

Why must hexadecimal text have an even number of digits?

Each byte is represented by two hexadecimal digits. An odd number of digits leaves the final byte incomplete and is rejected.

Can this tool decode arbitrary binary files?

No. The decoder is text-focused and requires the decoded bytes to be valid UTF-8. Binary file bytes that are not UTF-8 produce an error.

Is hexadecimal encryption?

No. Hexadecimal is a reversible byte representation and does not protect secrets or prove that data is authentic.

Looking for broader references? Browse all developer guides.