Hex Encoder / Decoder

Encode UTF-8 text to hexadecimal byte pairs or decode hex back to text.

  • Runs locally in your browser
  • No upload required

Try it

Processed entirely in your browser; nothing is uploaded.

Result
4869

Supported formats

Input
text
Output
text

Privacy

Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.

Processing
In your browser
Privacy level
Browser only

Encoded 5 character(s) of UTF-8 text to 5 hexadecimal byte(s).

How it works

  • Read the input as UTF-8 bytes.
  • Rendered each byte as two lower-case hexadecimal digits.
  • Concatenated the pairs into a single string.
  • Hexadecimal is an encoding, not encryption; it provides no confidentiality.
  • Uppercase and lowercase hex decode identically; the encoder emits lowercase.

Methodology

  1. Encode by rendering every UTF-8 byte as two lower-case hexadecimal digits.
  2. Decode by stripping whitespace, requiring an even digit count, and parsing each byte before decoding the bytes as UTF-8.
  3. Reject malformed input instead of producing a partial byte.

Usage

  1. Choose encode or decode.
  2. Paste text to encode, or a hexadecimal string to decode.
  3. Read the result; use Copy result to reuse it.

Examples

These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.

Encode ASCII

jsonSelect to copy
{
  "mode": "encode",
  "value": "Hello"
}

Encode Unicode

jsonSelect to copy
{
  "mode": "encode",
  "value": "café 🌍"
}

Decode hex

jsonSelect to copy
{
  "mode": "decode",
  "value": "48656c6c6f"
}

Limitations

Where hex is used

Hexadecimal is the conventional way to show byte values in hash digests, colour codes and binary protocols. Two digits per byte map cleanly to eight-bit values, which is why it is preferred over decimal for raw bytes.

Frequently asked questions

Why are non-ASCII characters several hex pairs long?
Hex shows UTF-8 bytes, and a character such as é takes two bytes, so it becomes four hexadecimal digits.
Does the decoder accept spaces or colons?
Whitespace is ignored, so spaces and line breaks are fine. Other separators such as colons are rejected because they are not hexadecimal digits.

Sources

  1. RFC 4648: The Base16, Base32, and Base64 Data Encodings — IETF
  2. MDN Web Docs — TextEncoder and TextDecoder — Mozilla