Cryptography Tools
What It Does
Encodes text to hexadecimal representation or decodes hex back to text.
How to Use It
- Paste text (to encode) or a hex string (to decode).
- Select “Encode” or “Decode”.
- View the result.
Options Explained
| Option | Description |
|---|---|
| Uppercase | Output hex digits as A–F instead of a–f |
| Separator | Add a separator between byte pairs (e.g., space, colon) |
Example
Input: hello → Encode → 68656c6c6f
About Hexadecimal Encoding
Hexadecimal (base-16) encoding represents each byte of data as two characters from the set 0–9 and a–f. Because one hex digit maps exactly to four bits, it provides a compact, human-readable representation of binary data. A single byte (0–255) becomes a two-character hex pair (00–ff), making hex the standard notation for raw byte sequences in computing.
Hex encoding doubles the size of the original data — each byte becomes two ASCII characters. Despite this overhead, its unambiguous byte-level representation makes it indispensable for low-level programming, networking, and cryptographic output. Hash digests, encryption keys, MAC addresses, and memory dumps are almost always displayed in hexadecimal.
This tool supports encoding text to hex (with optional space-separated, prefix, and C-array formatting) and decoding hex strings back to their original text. Both uppercase and lowercase hex digits are accepted during decoding.
Common Use Cases
- Inspecting and debugging raw byte values in network packets
- Representing MAC addresses and IPv6 addresses
- Defining CSS colors using hex notation (#RRGGBB)
- Displaying cryptographic hashes, keys, and initialization vectors
- Embedding byte arrays in C/C++ source code
- Analyzing binary file headers and magic numbers in forensic tools
What Is Hexadecimal Encoding?
Hexadecimal (hex) is a base-16 numeral system that uses digits 0–9 and letters A–F (or a–f) to represent values from 0 to 15. Each hex digit maps exactly to four binary bits, so one byte (8 bits) is represented by exactly two hex characters. This compact, readable mapping makes hex the standard notation for displaying binary data in computing — from memory addresses and color codes to cryptographic keys and network packet dumps. Hex encoding is lossless and reversible: encoding a byte sequence to hex and decoding it back yields the original bytes exactly.
Frequently Asked Questions
What is the difference between hex and Base64?
Hex encodes each byte as two characters (50% efficient), while Base64 encodes three bytes as four characters (75% efficient). Hex is more human-readable and easier to debug; Base64 is more compact for transport.
Are uppercase and lowercase hex digits equivalent?
Yes. “ff” and “FF” both represent the byte value 255. This tool accepts both during decoding and lets you choose the output case for encoding.
What is a C array export?
It formats the hex output as a C/C++ byte array literal (e.g., 0xFF, 0xA0, ...) that you can paste directly into source code for embedded systems or low-level programming.
Is my data sent to a server?
No. All encoding and decoding happens locally in your browser. Your data never leaves your device.
All conversions are performed client-side in your browser. No data leaves your device, ensuring full privacy.