Hex Encoder (Text to Hex)

Convert text to its hexadecimal byte representation. Each byte is shown as a two-digit hex value, space-separated.

Your data never leaves your browser

How to Use

  1. 1

    Enter your text

    Type or paste the text you want to convert to hexadecimal.

  2. 2

    Click Encode to Hex

    Each byte of the UTF-8 encoded text is shown as a two-digit hex value.

  3. 3

    Copy the result

    Click Copy to copy the hex output.

What is Hex Encoder?

A hex encoder converts text into its hexadecimal byte representation. Each character is encoded as UTF-8 bytes, and each byte is shown as a two-digit hex value (00–FF). The output is a sequence of hex pairs, separated by spaces — a format that is human-readable, easy to copy, and works with most byte-level tools and protocols.

Hex encoding is the standard way to display binary data in a human-readable form. Hash functions (MD5, SHA-256), cryptographic keys, color codes, MAC addresses, packet captures, and binary file inspectors all use hex. When you need to send binary data through a text-only channel, embed it in source code, or compare two binary blobs visually, hex is usually the right format.

This online hex encoder takes any text — ASCII, Unicode, emoji — and produces UTF-8 bytes shown as space-separated two-digit hex values. ASCII characters (a–z, 0–9) produce one byte each; characters outside ASCII (é, ñ, 你, 🚀) produce two to four bytes each, encoded in UTF-8. The result is reversible: paste it into our [Hex Decoder](/tools/hex-decode/) and you get back the original string. Everything runs in your browser, so sensitive text or proprietary data never leaves your machine.

For Base64 encoding (more space-efficient for transmission), see [Base64 Encoder](/tools/base64-encode/). For URL-safe encoding of special characters, use [URL Encoder](/tools/url-encode/). To learn more about byte-level encodings, read [Base64 Encoding Explained](/blog/base64-encoding-explained/).

FAQ

What encoding is used?
UTF-8. ASCII characters (a-z, 0-9, etc.) produce one byte each. Characters outside ASCII produce 2–4 bytes each (e.g. 'é' → 'c3 a9', emoji → 4 bytes).
What is the output format?
Space-separated two-digit hex values, e.g. '48 65 6c 6c 6f' for 'Hello'.
What characters are used in hexadecimal encoding?
Hexadecimal uses 16 symbols: digits 0–9 and letters A–F (case-insensitive). Each byte of input becomes exactly two hex characters, so the output is always twice the length of the input in bytes.
Why is my hex output longer than the input?
Hex encoding always produces 2 characters per byte. ASCII text doubles in length: 'Hello' (5 characters) becomes '48 65 6c 6c 6f' (without spaces, 10 characters). Multi-byte UTF-8 characters expand even more — 'é' is 2 bytes, so it becomes 4 hex characters; emoji are 4 bytes, becoming 8 hex characters. The space separators add overhead too but are easy to remove.
How do I get hex without space separators?
Copy the output and use any text editor or tool to remove spaces. In the terminal: `echo '48 65 6c 6c 6f' | tr -d ' '`. In JavaScript: `'48 65 6c 6c 6f'.replace(/\s/g, '')`. Some systems prefer `0x`-prefixed bytes (`0x48 0x65 0x6c`), colon-separated (`48:65:6c` for MAC addresses), or pure continuous strings (`48656c6c6f` for crypto keys) — convert the spaces to whatever format your target needs.

Related Articles

Related Tools