More games at WuGames.ioSponsoredDiscover free browser games — play instantly, no download, no sign-up.Play

Hex Encoder/Decoder

Text ⇄ hex converter — plain, 0x-prefixed, space-separated, upper/lowercase. Auto-detects on decode, handles UTF-8. For debugging, memory dumps, colors.

Hex Encoder/Decoder - Encode and Decode Hexadecimal Online

Hexadecimal is the universal compact notation for raw bytes — invented because writing binary (8 bits per byte) is unreadable for humans and decimal (varying digit count per byte) breaks alignment, but base-16 maps every byte to exactly two characters from a small predictable set (0-9 plus A-F). Every modern developer encounters hex daily: CSS color codes (#FF6347 is tomato red, three bytes for R/G/B), file signatures (PDF starts with %PDF or hex 25 50 44 46, PNG starts with 89 50 4E 47), MAC addresses, IPv6 fragments, memory dumps in debuggers, register values in assembly, cryptographic hashes, JWT segments, and protocol headers in Wireshark captures. This converter handles both directions seamlessly. Encode mode: type or paste text and choose your output format — plain compact ('48656c6c6f'), 0x-prefixed C-style ('0x48 0x65 0x6c 0x6c 0x6f'), or space-separated dump ('48 65 6c 6c 6f') — in uppercase or lowercase. Decode mode: paste hex in ANY of those formats (the parser auto-strips 0x, \x, spaces, line breaks, and even matched quote characters) and recover the original UTF-8 text. Bytes that don't form valid UTF-8 are flagged rather than silently corrupted. Size statistics let you see the 1:2 expansion factor that makes hex unsuitable for storing large binaries but ideal for short identifiers, magic numbers, and debug output. Note: hex is encoding, not encryption — anyone who sees your hex string can decode it instantly.

What is Hexadecimal encoding?

Hexadecimal (hex) is a base-16 number system that uses 16 symbols: 0-9 and A-F. Each hex digit represents 4 bits (half a byte). It's commonly used in programming to represent binary data in a more readable format.

Hex digits: 0 1 2 3 4 5 6 7 8 9 A B C D E F

Common uses:
- Memory addresses and dumps
- Color codes (#FF5733)
- Binary data representation
- Low-level programming
- Network protocols
- File signatures and magic numbers

Example:
Text: "Hi" → Bytes: [72, 105] → Hex: "4869"
Each character becomes 2 hex digits (1 byte = 2 hex digits).

How do I encode text to Hex?

Encoding is simple:

1. Select 'Encode' mode
2. Enter your text
3. Choose format (plain, 0x prefix, or space-separated)
4. Choose case (uppercase or lowercase)
5. Click 'Encode'

Examples:
- Plain: "Hello" → "48656c6c6f"
- 0x Prefix: "Hello" → "0x48 0x65 0x6c 0x6c 0x6f"
- Space: "Hello" → "48 65 6c 6c 6f"
- Uppercase: "Hello" → "48656C6C6F"

Each character is converted to its byte value, then represented as 2 hex digits.

How do I decode Hex?

Decoding is automatic:

1. Select 'Decode' mode (default)
2. Paste your hex string
3. Click 'Decode'

The tool automatically handles:
- Plain hex: "48656c6c6f"
- With 0x: "0x48 0x65 0x6c"
- With spaces: "48 65 6c 6c 6f"
- Mixed case: "48656C6C6F"
- \x format: "\x48\x65\x6c"

All formats decode to: "Hello"

Where is Hexadecimal used?

Hexadecimal is used extensively in programming:

1. Web Development:
- Color codes: #FF5733, #00AA00
- Character encoding
- URL encoding: %20, %2F

2. Low-Level Programming:
- Memory addresses: 0x7FFF5FC00000
- Pointer values
- Register values
- Assembly language

3. Debugging:
- Memory dumps
- Binary file inspection
- Network packet analysis
- Error codes

4. File Formats:
- File signatures (magic numbers)
- Binary file headers
- Checksum values
- Hash outputs (MD5, SHA)

5. Security:
- Cryptographic keys
- Hash representations
- Encryption output

Why use hex:
✓ Compact: Half the size of binary
✓ Readable: More human-friendly than binary
✓ Byte-aligned: 2 hex digits = 1 byte
✓ Industry standard: Widely understood

Hex Encoder/Decoder — Text ⇄ hex converter — plain, 0x-prefixed, space-separated, upper/lowercase. Auto-detects on decode, handles UTF-8. For
Hex Encoder/Decoder

What's the difference between hex formats?

Three common hex formats:

1. Plain Hex:
Format: 48656c6c6f
Use: Storage, databases, hash outputs
Pros: Compact, no extra characters

2. 0x Prefix:
Format: 0x48 0x65 0x6c 0x6c 0x6f
Use: Programming (C, JavaScript, Python)
Pros: Clear hex indication, readable
Example: int x = 0xFF;

3. Space Separated:
Format: 48 65 6c 6c 6f
Use: Memory dumps, documentation
Pros: Easy to read, byte boundaries clear

All formats represent the same data, just different presentation styles. Choose based on your use case.

Why does my emoji become four hex bytes instead of one or two?

Because emojis live outside the original 7-bit ASCII range, so they require multiple UTF-8 bytes. The Unicode standard assigns every character a code point — A is U+0041 (one byte in UTF-8: 41), é is U+00E9 (two bytes: C3 A9), 中 is U+4E2D (three bytes: E4 B8 AD), and 😀 is U+1F600 (four bytes: F0 9F 98 80). UTF-8 deliberately uses more bytes for higher code points to preserve backward-compatibility with ASCII while supporting all 1.1 million possible Unicode characters. This tool encodes text as UTF-8 by default — the most common encoding on the web and the only one safe for arbitrary text. If you specifically need Latin-1, UTF-16, or another encoding (rare in 2026), you'd have to pre-convert before pasting. For developer reference: a 'tweet' (formerly 280 ASCII chars) is up to 1120 hex bytes if filled entirely with 4-byte emojis.

How can I tell if a string of digits is hex, decimal, or just an ID?

Three quick tests. (1) If it contains any of the letters A-F (in any case), it must be hex. '1A2B3C' cannot be decimal. (2) If it starts with '0x' or '0X' (C/JavaScript convention), '\x' (Python bytes), '\u' (JavaScript Unicode escape), '#' followed by 3 or 6 chars (CSS color), or '%' followed by 2 chars (URL encoding), it's hex by convention. (3) If it's exactly 32, 40, 64, 96, or 128 characters of [0-9a-f], it's likely a cryptographic hash: 32=MD5, 40=SHA-1, 64=SHA-256, 96=SHA-384, 128=SHA-512. If none of those clues fire, the digits could be either — context wins. A 16-character all-digit string in an address might be a memory pointer (hex); the same string in a phone field is decimal. When uncertain, try decoding as hex with this tool: valid pairs that produce printable ASCII or valid UTF-8 are usually intentional hex; gibberish output suggests the source was not hex-encoded text.

Is my data safe?

Yes, completely safe:

✓ 100% client-side processing
✓ No data uploaded to servers
✓ No tracking or logging
✓ Works offline after page load
✓ Open source and verifiable

⚠️ Important: Hex encoding is NOT encryption!
- Anyone can decode hex
- Provides no security
- Don't encode sensitive data thinking it's protected
- Use proper encryption for security

Hex is just a different way to represent data, not a security measure.

Key Features

  • Encode text to Hexadecimal instantly
  • Decode hex strings to text
  • Multiple format support: plain, 0x prefix, space-separated
  • Uppercase and lowercase options
  • Auto-detect and handle various hex formats on decode
  • Real-time size statistics
  • One-click mode swap
  • Copy to clipboard
  • Download results
  • Upload files
  • 100% client-side - your data stays private
  • Works offline
  • Mobile-friendly
  • No registration required