3tej home

What is Hex Encoder / Decoder?

A Hex Encoder / Decoder computes hex encoder / decoder from the inputs you provide. It applies the standard formula to the values you enter and returns the result instantly, without sending any data to a server. Encode text as hexadecimal (48656c6c6f) or decode hex back to text.

Hex Encoder / Decoder

Convert text to hexadecimal and back. Each character becomes 2 hex digits.

🔒 Browser-only ⚡ Instant 💸 Free forever 📡 Works offline 🚫 No signup
← Utilities

TLDR

Encode text to lowercase hex (each character becomes 2 hex digits, no spaces) or decode hex back to text. Detects input direction automatically.

Runs entirely in your browser. No upload, no signup, no logging. Output is for personal or commercial use; we don't claim any rights.

About hex encoding

Hexadecimal, or base 16, is a number system that uses sixteen digits: 0 through 9 and then A through F for the values ten to fifteen. A hex encoder converts text into the hexadecimal representation of its underlying bytes, and a decoder reverses it. Each byte (8 bits) maps to exactly two hex digits, so the capital letter H, which is byte value 72 in decimal, becomes 48 in hex, and the word "Hello" becomes 48656c6c6f. This tool encodes text to hex and decodes hex back to text, entirely in your browser.

Hex is popular because it lines up neatly with binary: one hex digit represents exactly four bits (a nibble), and two hex digits represent one byte. That makes it far more compact and readable than long strings of ones and zeros while still mapping cleanly to how computers store data. You see it everywhere bytes need to be shown to humans: colour codes (#0d9488), MAC addresses, memory dumps, cryptographic hashes, and the escape sequences in URLs and source code.

How it works

Encoding walks through the text, converts each character to its byte value (or values, for multi-byte characters), and prints each byte as a two-digit hex number. Decoding splits the hex string into pairs and reverses the process.

encode: text -> UTF-8 bytes -> each byte as 2 hex digits
decode: hex pairs -> bytes -> UTF-8 text
'A'  = 65 decimal = 0x41
'0'  = 48 decimal = 0x30
UTF-8: an emoji or accented letter spans several bytes
  • Two hex digits per byte: values run from 00 (0) to FF (255), covering every possible byte.
  • UTF-8 matters: plain ASCII is one byte per character, but accented letters and emoji use two to four bytes, so they produce more hex digits.
  • Case is cosmetic: 4A and 4a are the same value; this tool reads either when decoding.

Worked example

Encode the word "Hi!" to hex by hand:

  1. H is byte 72 decimal, which is 48 in hex.
  2. i is byte 105 decimal, which is 69 in hex.
  3. ! is byte 33 decimal, which is 21 in hex.
  4. Concatenate: 486921.
  5. Decode check: split into 48, 69, 21, map back to H, i, !, giving "Hi!".
Result: "Hi!" encodes to 486921, six hex digits for three ASCII characters. The encoding is fully reversible, so decoding 486921 returns exactly "Hi!" with no loss.

Hex reference for common characters

CharacterDecimal byteHex
space3220
04830
A6541
a9761
newline100A

Common pitfalls

  • Odd number of hex digits. Every byte needs two digits, so a hex string must have an even length; an odd count means a character was dropped.
  • Confusing hex with base64. Both encode bytes, but hex uses 0-9A-F and doubles the length, while base64 is more compact and uses A-Z, a-z, 0-9, +, /.
  • Forgetting UTF-8 multi-byte characters. An emoji is not one byte, so it produces several hex pairs; assuming one character equals one byte breaks on non-ASCII text.
  • Stray spaces or 0x prefixes. Decoders may choke on "0x" prefixes or spaces between pairs unless those are stripped first.
  • Treating hex as encryption. Hex is a representation, not a cipher; anyone can decode it instantly, so it provides no security.

Related tools

Frequently asked questions

What is hexadecimal encoding?

Hexadecimal, or base 16, represents data using sixteen digits: 0 through 9 and A through F. Hex encoding converts text into the hex representation of its bytes, where each byte becomes exactly two hex digits. For example, the letter H (byte value 72) becomes 48, and the word Hello becomes 48656c6c6f. It is a human-readable way to show raw bytes.

Why is hex used instead of binary?

Because one hex digit maps to exactly four bits and two hex digits map to one byte, hex lines up perfectly with how computers store data while being far shorter and more readable than long binary strings. That is why colour codes, MAC addresses, memory dumps, and cryptographic hashes are all shown in hex.

How many hex digits does a character take?

A plain ASCII character is one byte, which is two hex digits. But text uses UTF-8, so accented letters and emoji span two to four bytes and therefore produce four to eight hex digits. That is why a single emoji can encode to a surprisingly long hex string.

Is hex encoding the same as encryption?

No. Hex is just a representation of bytes, not a cipher. Anyone can decode a hex string instantly with a tool like this one, so it provides no secrecy or security. It is meant for displaying and transporting data in a readable form, not for protecting it.

Why does my hex string fail to decode?

The most common reason is an odd number of digits: because every byte needs two hex digits, the string length must be even. Stray spaces, a 0x prefix, or non-hex characters (anything outside 0-9 and A-F) will also cause decoding to fail. Clean the string to valid hex pairs and try again.