Tools

Home
JSON FormatterSQL FormatterJS ValidatorMinify CSS
Merge PDFCompress PDFImage to PDF
JPG to PNGPNG to WebPCrop Image

Base64 to Hexadecimal Converter

Decode Base64 strings to hexadecimal representation with formatting options

Your data never leaves your browser
Base64 Input0 chars
Hex Output0 bytes
Ready·

Drop a Base64 string in, get hex bytes out — uppercase, lowercase, spaced, or 0x-prefixed, however you need them. Handy when you're debugging a JWT signature, inspecting certificate fields, or comparing encoded payloads byte by byte. And everything runs in your browser. Nothing gets uploaded.

How It Works

Paste Base64
→
Decode to Bytes
→
Output Hex

Each Base64 character maps to a 6-bit value. The tool groups those bits into 8-bit bytes, then converts each byte to its two-character hex equivalent. A 4-character Base64 chunk becomes 3 bytes, which becomes 6 hex digits. Padding characters (=) at the end just signal that the last group has fewer than 3 bytes.

Examples

Short text string

Converting a Base64-encoded "Hello" to its hex representation.

INPUT
SGVsbG8=
OUTPUT
48 65 6C 6C 6F

API authentication token

You pulled a token from an API header and need hex bytes for debugging a signature mismatch. The raw bytes tell you exactly what the server signed.

INPUT
dGhlIHF1aWNrIGJyb3duIGZveA==
OUTPUT
74 68 65 20 71 75 69 63 6B 20 62 72 6F 77 6E 20 66 6F 78

Binary data from a certificate file

SSL certificate fields are often Base64-encoded in PEM files. Converting to hex lets you inspect ASN.1 structures byte by byte — useful when a cert isn't parsing correctly and you need to find where the encoding breaks.

INPUT
AQIDBA==
OUTPUT
01 02 03 04

Who Uses This

👨‍💻 Developers

Debugging encoded payloads in APIs, JWTs, and WebSocket messages by inspecting the raw bytes.

🔏 Security Analysts

Examining encoded data in network captures, certificate fields, and authentication tokens.

🎓 Students

Learning how Base64 encoding maps to actual byte values in computer science and cryptography classes.

🖧 Network Engineers

Comparing encoded config values against expected hex patterns when troubleshooting device firmware.

Common Mistakes

Pasting hex instead of Base64

If your input already looks like "4A 6F 68 6E", that's hex — not Base64. Base64 strings only contain letters, numbers, +, /, and = padding. Feeding hex into a Base64 decoder gives garbage output.

Including the "data:" URI prefix

Data URIs start with something like "data:image/png;base64,". Strip everything before and including the comma. The prefix isn't part of the Base64 data and will cause a decode error.

Confusing URL-safe and standard Base64

URL-safe Base64 uses - and _ instead of + and /. Most tools handle both, but if you see unexpected results, check which variant your source data uses. JWT tokens, for example, always use the URL-safe version.

Technical Details

Frequently Asked Questions

What is the difference between Base64 and hexadecimal?

Base64 encodes binary data using 64 printable ASCII characters, making it about 33% larger than the original. Hex represents each byte as two characters (0-9, A-F), so it doubles the size. Base64 is more compact for transmission; hex is easier to read byte-by-byte when debugging.

How do I convert Base64 to hex manually?

Take each Base64 character, look up its 6-bit value in the Base64 alphabet table, concatenate all the bits, then split them into 8-bit groups. Each 8-bit group is one byte — convert that to two hex digits. For "SGk=" you'd get S=18, G=6, k=36 in binary, which gives bytes 0x48 0x69, spelling "Hi".

Can I convert hex back to Base64?

Yes, it's the reverse process. Take each pair of hex digits, convert to a byte, then re-encode the byte array as Base64. We have a separate hex-to-Base64 converter on this site if you need to go the other direction.

Why does my Base64 string have = signs at the end?

The = signs are padding. Base64 works in groups of 3 bytes (4 characters). If your data isn't evenly divisible by 3, padding fills the gap. One = means two bytes in the last group; two == means one byte. Some systems skip the padding entirely — both work fine here.

Is my data safe when using this tool?

Your data stays on your machine. The conversion runs entirely in JavaScript inside your browser — nothing is sent to a server. You can disconnect from the internet and the tool still works. No cookies, no tracking, no server logs.

Share: