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

Why this tool is safe

Your data never leaves your device — everything runs in your browser.

No server uploads. Other tools send your files to their servers. Ours don't.
Zero tracking of content. We never see, store, or log anything you convert.
Works offline. Once loaded, the tool works without an internet connection.

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="))  # 48656c6c6f

Frequently 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%.