Base64 to Hex
Convert between Base64 and hexadecimal
Base64
Hex
What Is Base64 to Hex Conversion?
Base64 to hex conversion transforms data between two common binary-to-text encoding schemes. Base64 represents binary data using 64 ASCII characters (A-Z, a-z, 0-9, +, /), encoding every 3 bytes as 4 characters. Hexadecimal represents each byte as exactly two characters from a 16-symbol alphabet (0-9, a-f). Converting between these formats is a two-step process: decode the Base64 string into its raw bytes, then re-encode those bytes in the target format.
Hexadecimal notation is the standard representation for binary data in low-level programming, cryptography, and network protocols. Each hex character maps directly to a 4-bit nibble, making it straightforward to read individual byte values. A SHA-256 hash, for example, is almost always displayed as a 64-character hex string. Base64, by contrast, is optimized for compactness — the same hash takes only 44 characters in Base64 — and is the standard encoding for email attachments (MIME), data URIs, and API payloads.
Both encodings are defined in RFC 4648. The conversion between them is lossless: no data is added or removed, only the textual representation changes. This makes Base64-to-hex conversion a routine operation when debugging encrypted payloads, inspecting certificate fingerprints, or verifying hash outputs across systems that use different display formats.
Why Use This Base64 to Hex Converter?
This tool converts between Base64 and hexadecimal directly in your browser. No data leaves your machine, and the conversion happens in real time as you type.
Base64 to Hex Use Cases
Base64 vs Hexadecimal Encoding
Base64 and hexadecimal both convert binary data to printable text, but they make different trade-offs between compactness and readability. The table below summarizes the key differences.
| Property | Base64 | Hexadecimal |
|---|---|---|
| Alphabet | A-Z a-z 0-9 + / = | 0-9 a-f |
| Bits per character | 6 | 4 |
| Size overhead | ~33% larger than raw | 100% larger than raw |
| Readability | Compact but opaque | Each byte visible as 2 chars |
| Primary use | Email, data URIs, APIs | Crypto hashes, MAC addresses, colors |
| Specification | RFC 4648 | IEEE 754, RFC 4648 sec 8 |
Conversion Examples
The table below shows identical byte sequences in their Base64 and hexadecimal representations. Notice that hex output is always exactly twice the byte count, while Base64 length equals ceil(byteCount / 3) * 4.
| Input (text / bytes) | Base64 | Hex |
|---|---|---|
| Hello | SGVsbG8= | 48656c6c6f |
| AB | QUI= | 4142 |
| 0xFF | MHhGRg== | 30784646 |