Base64 to Hex Converter
Convert between Base64 and hexadecimal representations. Supports both directions with instant conversion.
Last Updated: September 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%.
Related Tools
Base64 Converter
Encode text to Base64 or decode Base64 to text — all in one tool
Base64 to Binary
Convert Base64 to 8-bit binary representation and binary back to Base64
Base64 to ASCII
Decode Base64 to text with character-by-character ASCII breakdown
Base64 Validator
Validate Base64 strings with detailed character set, padding, and length analysis