Convert Base64 to Hex
Paste Base64 to decode it into hexadecimal — with the exact byte count and your choice of compact or spaced, upper- or lowercase output.
ⓘ Nothing to convert yet
Nothing to convert yet — paste your data or drop a file to begin.
Inspection Report
- Detected Type
- —
- MIME Type
- —
- Encoding
- —
- Input Length
- —
- Decoded Size
- —
- Padding Status
- —
- Data URI
- —
- File Signature
- —
- Preview Availability
- —
How to convert Base64 to Hex
To convert Base64 to hex, paste the Base64 string into the tool above. It validates and decodes the data, reports the exact number of bytes, and shows the result as hexadecimal — compact or spaced by byte, uppercase or lowercase. The conversion runs entirely in your browser, and you can copy the hex with one click.
How to Use
- Paste the Base64 string into the input box.
- The tool validates the input; if padding is missing or URL-safe characters appear, use the one-click fix.
- Read the byte count in the inspector to confirm the decoded size.
- Choose your format: compact (89504e47...) or spaced (89 50 4e 47...), uppercase or lowercase.
- Click Copy. To go back, use the Hex to Base64 tool.
Real Example
The Base64 string SGVsbG8= decodes to the five bytes 48 65 6c 6c 6f — the ASCII text "Hello" — and the inspector reports Decoded Size: 5 bytes. A PNG's Base64 start iVBORw0KGgo becomes 89 50 4e 47 0d 0a 1a 0a, which is exactly the eight-byte PNG file signature. Seeing data as hex makes signatures, headers and byte patterns visible in a way Base64 never does.
Code Snippets
// Base64 to spaced uppercase hex (browser)
const bytes = Uint8Array.from(atob(base64), c => c.charCodeAt(0));
const hex = [...bytes].map(b => b.toString(16).padStart(2, '0')).join(' ').toUpperCase();How Base64 to Hex Works
Hexadecimal is the most readable way to look at raw bytes: each byte becomes exactly two characters, 00 through ff. That one-to-two mapping is why developers reach for hex when inspecting file signatures, packet captures, hashes and binary protocols. This tool decodes Base64 to bytes first, so validation problems are caught before you ever see hex, and the byte count tells you the true size of the decoded data. Spaced output groups bytes visually for reading; compact output is what most tools and documentation expect when pasting.
Common Use Cases
- Inspecting file signatures and binary headers inside Base64 payloads.
- Comparing decoded data against a hex dump from another tool.
- Checking hashes, keys or identifiers that travel as Base64.
- Debugging binary protocols that mix Base64 transport with hex documentation.