Hex Encoder / Decoder Free
Convert text to its hexadecimal byte representation and decode hex strings back to text. Supports uppercase and lowercase output, space-separated bytes, 0x prefix notation, and UTF-8 multi-byte characters. Runs entirely in your browser — data never leaves your device.
Input
Output
Pro — binary file to hex dump, hex to binary, color hex tools, batch encode, API access
API access · Priority queue · Team workspace
How It Works
Paste Your Input
Paste the text you want to convert to hex, or paste a hex string you want to decode back to text. For text-to-hex, any Unicode text is accepted — ASCII characters, accented letters, CJK characters, and emoji are all supported via UTF-8 encoding. For hex-to-text, the tool accepts hex in any format: no separators (ffa3), space-separated (ff a3), colon-separated (ff:a3), dash-separated (ff-a3), or 0x-prefixed (0xff 0xa3).
Choose Format
Choose whether the hex output should use lowercase letters (a-f) or uppercase (A-F). Select a separator: none for compact hex strings used in hashing output and binary protocols, space-separated for readable byte lists, colon-separated for MAC address and certificate fingerprint format, dash-separated for UUID-style formatting, or 0x prefix notation common in C, Python, and assembly language.
Copy or Download
Click Text → Hex or Hex → Text to run the conversion. The output appears in the right panel. Copy it to clipboard for use in network debugging, cryptography tools, database queries, color pickers, or code. The stats bar shows the number of bytes encoded and the output length, helping you verify that multi-byte UTF-8 characters are producing the expected number of hex pairs.
Hex Encoder Features
UTF-8 aware hex encoding with flexible separator and case formatting
UTF-8 Multi-Byte Support
Text is encoded to UTF-8 bytes before hex conversion, producing the correct hex representation for all Unicode characters. A standard ASCII character produces one hex byte pair (e.g., 61 for "a"). A two-byte UTF-8 character like é produces two pairs (c3 a9). Emoji and CJK characters produce three or four pairs. This matches the hex output expected by networking tools, hash functions, and databases.
Upper & Lowercase Output
Toggle between uppercase (FF A3) and lowercase (ff a3) hex output. Lowercase is conventional in most Linux tools, network protocols, and cryptographic hash output. Uppercase is common in Windows tools, assembly listing files, and some database systems. Both are functionally equivalent — the choice is purely stylistic and depends on the requirements of the system consuming the hex string.
Multiple Separator Formats
Five separator options cover common use cases: no separator for cryptographic hash output (ffa3b2), space-separated for readable byte dumps and Wireshark output (ff a3 b2), colon-separated for MAC addresses and TLS fingerprints (ff:a3:b2), dash-separated for UUID-style IDs, and 0x-prefixed for C arrays and Python byte literals (0xff 0xa3 0xb2).
Flexible Hex Input Parsing
When decoding, the tool automatically strips spaces, colons, dashes, 0x prefixes, and whitespace before parsing. This means you can paste hex output from any tool — Wireshark packet hex dumps, xxd output, Python hex strings, MAC addresses, SHA-256 hashes, or color codes — without reformatting them first. Mixed-case hex digits are accepted (FF and ff are both valid).
Validation & Error Reporting
Invalid hex input (odd number of hex digits, non-hex characters, or invalid UTF-8 byte sequences) is caught and reported with a clear error message indicating the position and nature of the problem. This prevents silent decoding errors that would produce garbled or truncated output, which is especially important when decoding network packet data or binary protocol messages where every byte matters.
100% Private
All encoding and decoding runs locally in your browser using the TextEncoder API. No data is transmitted to any server. Safe for encoding binary protocol data, cryptographic key material, network packet payloads, and proprietary binary formats that must not be exposed to third-party services or analytics systems.
Free vs Pro
| Feature | Free | Pro |
|---|---|---|
| Text to hex / hex to text | ||
| Separator & case formatting | ||
| Binary file to hex dump | — | |
| Hex to binary file download | — | |
| xxd-style hex view | — | |
| REST API access | — |
Frequently Asked Questions
Hexadecimal (hex) encoding represents each byte of binary data as two hexadecimal digits (0–9 and a–f). A byte can hold 256 values (0–255), and each hex digit represents 16 values (0–15), so two hex digits exactly represent one byte. For text encoding, the text is first converted to bytes using a character encoding (usually UTF-8), then each byte is represented as two hex digits. Common uses include color codes (#ff8800), MAC addresses, SHA hash output, and network packet inspection.
The letter "a" has ASCII code 97 in decimal. Converting 97 to hexadecimal: 97 ÷ 16 = 6 remainder 1, so 97 decimal = 61 hexadecimal. Similarly, "A" (uppercase) has ASCII code 65 = 0x41, and space has ASCII code 32 = 0x20. UTF-8 is backward-compatible with ASCII for the first 128 characters, so all standard ASCII letters, digits, and punctuation produce single hex byte pairs.
Characters above U+007F (non-ASCII) are encoded using multiple bytes in UTF-8. For example, é (U+00E9) requires two UTF-8 bytes (0xC3, 0xA9), producing four hex digits: c3 a9. CJK characters typically require three bytes (six hex digits). Emoji often require four bytes (eight hex digits). This is correct UTF-8 behavior — the hex output faithfully represents the UTF-8 byte stream, which is what most systems that work with text bytes expect.
The 0x prefix is a convention from C programming that signals to the compiler (and human readers) that the following number is hexadecimal. For example, 0xff means hex FF = decimal 255. This notation is widely used in C, C++, Java, JavaScript, Python, Go, and most other languages when writing literal hex values in source code. Assembly languages typically use the h suffix (FFh) or $ prefix instead.
SHA-256 hashes are not text — they are 32-byte binary values that happen to be displayed as 64 hex characters. Decoding the hex back produces the raw binary bytes of the hash, which are not meaningful as readable text (they will appear as garbage or control characters). SHA-256 hashes cannot be reversed to the original input by design — they are one-way cryptographic functions. If you need to inspect the hash bytes, use the decode function to see the raw binary content, but expect non-printable characters in the output.
Both represent binary data as printable ASCII, but with different efficiency. Hex encoding uses 2 characters per byte (100% overhead — output is twice the binary size). Base64 uses about 1.33 characters per byte (~33% overhead), making it more compact for large data. Hex is more human-readable (each byte is directly visible as two digits) and is standard for checksums, hashes, and protocol debugging. Base64 is preferred for embedding binary data in text protocols like HTTP or JSON where compactness matters.