What Hex Encoding Is
Hexadecimal is a base-16 number system. Every byte (0-255) can be represented as exactly two hex digits (00-FF). Hex encoding converts any byte sequence into a string of hex characters — two chars per byte:
"Hello" → 48 65 6c 6c 6f "Hello, World!" → 48 65 6c 6c 6f 2c 20 57 6f 72 6c 64 21
Hex is 100% reversible — decode by reversing the byte-to-hex mapping. It is a format, not a protection.
Where Hex Is Used
- Color codes — CSS
#FF5733, design palettes - Hashes — MD5, SHA-1, SHA-256 output (64 hex chars for SHA-256)
- Binary dumps — hex editors, network packet analysis
- HTTP headers — Content-MD5, ETag
- Debugging — memory inspection, encoding verification
- Byte sequences — magic bytes, protocol identifiers
- Escaped strings —
\x48\x65\x6c\x6c\x6fin C/Python
Hex Is Not Encryption
The Nine Modes
| Mode | Input | Output Example | Reversible? |
|---|---|---|---|
| 🔤 Standard Encode | Plain text (UTF-8) | Hello → 48656c6c6f | ✅ Via Decode |
| 🔓 Standard Decode | Hex | 48656c6c6f → Hello | ✅ Via Encode |
| 👁️ Spaced Hex | Plain text | 48 65 6c 6c 6f | ✅ Via Decode Spaced |
| 🔓 Decode Spaced | Spaced hex | Reverse | ✅ Via Spaced |
| 🔢 0x Prefix | Plain text | 0x48 0x65 0x6c 0x6c 0x6f | ✅ Via Decode 0x |
| 🔓 Decode 0x | 0x-prefixed hex | Reverse | ✅ Via 0x |
| 🔐 XOR + Hex Encode | Plain text + key | Hex(XOR(text, key)) | ✅ Via XOR Decode |
| 🔓 XOR + Hex Decode | Hex + key | Reverse | ✅ Via XOR Encode |
| 📁 File to Hex | File upload | Hex dump of file bytes | ✅ Via Standard Decode |
UTF-8 Encoding — Multi-Byte Characters
Text is encoded as UTF-8 before converting to hex. This means:
| Input | UTF-8 Bytes | Hex | Bytes |
|---|---|---|---|
A | [0x41] | 41 | 1 |
é | [0xC3, 0xA9] | c3a9 | 2 |
€ | [0xE2, 0x82, 0xAC] | e282ac | 3 |
😀 | [0xF0, 0x9F, 0x98, 0x80] | f09f9880 | 4 |
The decoder reverses this exactly: hex → bytes → UTF-8 decode. Round-trip on any valid UTF-8 text is guaranteed.
Spaced Hex — Readability
Continuous hex (48656c6c6f) is hard to read. Spaced hex (48 65 6c 6c 6f) is the standard for hex dumps, debugging, and documentation. Both represent the same bytes.
0x Prefix — Programming Convention
Many languages (C, JavaScript, Python, Rust) prefix hex literals with 0x:
const bytes = [0x48, 0x65, 0x6c, 0x6c, 0x6f];
The 0x-prefixed mode produces output ready to paste into code.
Flexible Decoding
The decoder accepts hex in multiple formats:
48656c6c6f— continuous48 65 6c 6c 6f— spaced48-65-6c-6c-6f— hyphenated48:65:6c:6c:6f— colon-separated0x48 0x65 0x6c 0x6c 0x6f— 0x-prefixed\x48\x65\x6c\x6c\x6f— backslash-x prefixed- Any combination with mixed whitespace
The decoder strips all separators and prefixes before parsing, so any reasonable format works.
XOR + Hex — Exact Algorithm
Encode: 1. Encode text as UTF-8 bytes 2. Encode key as UTF-8 bytes 3. For each input byte i: output[i] = input[i] ^ key[i mod keyLength] 4. Convert output bytes to hex Decode: 1. Parse hex to bytes (with flexible separators) 2. Encode key as UTF-8 bytes 3. For each input byte i: output[i] = input[i] ^ key[i mod keyLength] 4. Decode output bytes as UTF-8 text
File to Hex Dump
Uploads a file and displays its contents as a hex dump with configurable bytes per row. The output includes:
- File name and size
- Hex bytes in rows (8, 16, 24, or 32 bytes per row)
- Line numbers for navigation
Common uses:
- Verify file contents — check magic bytes, headers
- Debug binary protocols — inspect actual byte sequences
- Cryptography — see raw key material, IVs, ciphertext
- Forensics — manual byte-level analysis
The output is copy-pasteable as standard hex, which can be re-decoded with the Standard Decode mode.
When to Use Each Mode
| Use Case | Recommended Mode |
|---|---|
| Inspect raw bytes | 🔤 Standard Encode |
| Read hex data | 🔓 Standard Decode |
| Readable hex for docs | 👁️ Spaced Hex |
| Paste into C/JS/Python | 🔢 0x Prefix |
| Basic obfuscation layer | 🔐 XOR + Hex |
| Inspect a binary file | 📁 File to Hex |
| Real data protection | ❌ Not any of these — use AES-GCM |
What Hex Cannot Do
- It cannot encrypt. Hex encoding is reversible by anyone with zero effort.
- It cannot protect API keys. Even XOR + hex is trivially reversible.
- It cannot replace HTTPS. If you need confidentiality in transit, use TLS.
- It cannot replace password hashing. Hex is reversible; password hashing is one-way. Use bcrypt or Argon2.
- It cannot hide secrets. Hex is often used to obscure malware payloads — but this does not hide the malware from antivirus.
When You Actually Need Encryption
- AES-256-GCM — authenticated encryption for symmetric encryption
- ChaCha20-Poly1305 — modern authenticated encryption
- GPG or age — file-level encryption
- HTTPS/TLS — encryption in transit
- bcrypt, scrypt, Argon2 — password hashing (one-way)
- Secrets managers — AWS Secrets Manager, HashiCorp Vault
Frequently Asked Questions
Is hex encryption?
Does the tool support Unicode text?
What hex formats can be decoded?
48656c6c6f), spaced hex, hyphenated, colon-separated, 0x-prefixed, and \x-prefixed formats. It strips all separators and prefixes automatically.Is XOR + hex more secure?
Does the tool verify round-trip?
What happens if I paste invalid hex?
Can I decode a file's hex dump?
What is the maximum file size for hex dump?
xxd or hexdump command-line tools.Is my data uploaded to your server?
What is the maximum XOR key length?
Does the tool support binary files?
What does "0x" mean?
0x is the standard prefix for hexadecimal literals in C, C++, Java, JavaScript, Python, Rust, Go, and many other languages. It tells the compiler or interpreter that the following digits are hex.Can I use this for hex color codes?
#FF5733 is RGB hex, not text hex. If you want to convert "FF5733" to the text it represents, that would not make sense — it is color data, not text. This tool converts between text and its UTF-8 byte representation.