Base64 to Hex Converter
Base64 and hexadecimal are both ways to write raw bytes as printable ASCII, but they hide different detail. Hex shows you every byte cleanly in two digits; Base64 is denser but harder to read. Converting from Base64 to hex is what you do when you are debugging a token, inspecting a key fingerprint, or comparing byte sequences across tools that prefer different encodings.
How the conversion works
-
1
Paste the Base64 string
Works with standard, URL-safe and padded or unpadded Base64.
-
2
The string is decoded to raw bytes
Each 4 Base64 characters become 3 bytes.
-
3
Each byte is expressed as two hex digits
Choose uppercase or lowercase output.
-
4
Read the hex
Optionally with spaces, `0x` prefixes or continuous.
Worked example
Base64 SGVsbG8= decodes to 5 bytes:
| Base64 chars | Bytes | Hex |
|---|---|---|
| SGVs | 48 65 6C | 48 65 6C |
| bG8= | 6C 6F | 6C 6F |
So SGVsbG8= in hex is 48 65 6C 6C 6F (the ASCII for Hello).
When hex tells you more than Base64
- Certificate fingerprints — SHA-1 and SHA-256 fingerprints are canonically shown in hex with colons:
AB:CD:.... Converting a Base64-encoded hash to hex lets you match it byte-for-byte. - Key material — AES keys, HMAC secrets, Ed25519 private keys are usually logged in hex. Same key in Base64 looks completely different; converting lets you verify it is the same.
- JWT signatures — The
signaturesegment of a JWT is URL-safe Base64. Converting to hex makes it trivial to compare against an expected value in a debug log. - TLS session IDs / handshake data — Wireshark shows them in hex; your application may log them in Base64.
Output format options
Base64: SGVsbG8=
Hex (raw): 48656C6C6F
Hex (spaced): 48 65 6C 6C 6F
Hex (0x): 0x48 0x65 0x6C 0x6C 0x6F
Hex (colons): 48:65:6C:6C:6F
Hex (C): \x48\x65\x6C\x6C\x6F
Common gotchas
- URL-safe Base64 — If input contains
-or_, it is the URL-safe variant. This tool accepts both automatically. - Padding — Accept Base64 with or without trailing
=. Decoders usually tolerate it. - Whitespace in pasted input — Line breaks and spaces are stripped before decoding.
Frequently Asked Questions
Yes, significantly. Hex uses 2 characters per byte; Base64 uses about 1.33. So hex is 50% longer than Base64, but every byte is clearly visible in hex and the encoding is case-insensitive.
Yes — use the Hex to Base64 Converter. The byte sequence is preserved in either direction; only the textual representation changes.
Either the input was not actually Base64, had characters from a different alphabet (Crockford Base32, Base58), or was truncated. Check the source; try decoding as raw text first to see if it looks meaningful.
Yes. Both hex and Base64 are round-trip representations of bytes; converting between them preserves the byte sequence exactly.
Related Tools
Color Palette Generator
Generate monochromatic, analogous, complementary, triadic or tetradic color palettes from a base HEX color and export copy-ready CSS variables.
Random Color Palette Generator
Generate random color palettes from 2 to 15 swatches, choose a vibrant, pastel, muted or dark style, then copy HEX codes or CSS variables.
HEX Color Picker
Pick any colour visually and get its HEX, RGB, HSL, HSV and CMYK values, plus accessibility contrast against white and black.
BBCode to HTML Converter
Convert BBCode (bulletin-board markup) to clean HTML. Handles formatting tags, lists, quotes, code, images, links and tables.
JSON Formatter
Paste JSON to pretty-print with 2 or 4 spaces, minify it to compact output, or run a quick syntax check before copying the result.
ASCII to Binary Converter
Convert any ASCII string to its binary representation. Every character becomes eight bits, space-separated, ready to paste into a protocol trace or homework.