How to convert Base64 to hex
- Choose the direction: Base64 → Hex or Hex → Base64.
- Paste your input. Hex input may contain spaces, colons,
0xor\xprefixes. - Pick the letter case and byte separator, then copy the result.
Base64 vs hexadecimal
Both encodings represent binary data as text. Hexadecimal uses 2 characters per byte (100% overhead) and is easy to read byte by byte, which is why hashes and keys are often shown in hex. Base64 uses 4 characters per 3 bytes (33% overhead) and is more compact for transport.
| Text | Base64 | Hex |
|---|---|---|
| Hi | SGk= | 48 69 |
| Hello | SGVsbG8= | 48 65 6c 6c 6f |
Frequently asked questions
How do I convert a SHA-256 hash from Base64 to hex?
Paste the Base64 hash (44 characters ending in =) and you get 64 hexadecimal characters, the format used by most command-line tools.
Can hex input contain spaces or 0x prefixes?
Yes. Spaces, line breaks, colons, dashes and 0x or \x prefixes are removed automatically before conversion.
Why must hex have an even number of digits?
Each byte is written as exactly two hex digits. An odd count means a digit is missing, usually a leading zero.