Base64 to Hex Converter
Convert between Base64 and hexadecimal representations. Supports both directions with instant conversion.
Last Updated: August 2026
100% Client-Side — Your data never leaves your device
Base64 to Hex in Code
Convert between Base64 and hexadecimal in your language.
Python
import base64
import binascii
# Base64 → Hex
b64 = "SGVsbG8="
raw = base64.b64decode(b64)
hex_str = binascii.hexlify(raw).decode()
print(hex_str) # 48656c6c6f
# Hex → Base64
hex_str = "48656c6c6f"
raw = bytes.fromhex(hex_str)
b64 = base64.b64encode(raw).decode()
print(b64) # SGVsbG8=
# One-liners
b64_to_hex = lambda s: base64.b64decode(s).hex()
hex_to_b64 = lambda s: base64.b64encode(bytes.fromhex(s)).decode()
print(b64_to_hex("SGVsbG8=")) # 48656c6c6fFrequently Asked Questions
Search below or browse through our most commonly asked questions.
Hexadecimal (Hex) uses 16 characters (0-9 and A-F) to represent binary data. It's heavily used in cryptography and computer networking.
Base64 is much more space-efficient. Hex increases data size by 100%, whereas Base64 only increases it by 33%.