Decode unknown Base64 into the right file
A Base64 value usually has no trustworthy filename. This tool reads magic bytes from the decoded payload and proposes a MIME type and extension for images, PDF, ZIP, gzip, 7-Zip, RAR, fonts, audio, video, text, and other common formats.
Raw Base64, full data:*/*;base64,... values, and RFC 4648 Base64URL are accepted. Whitespace is removed, missing padding is restored when mathematically possible, and illegal characters or impossible final groups are rejected before a download is created.
Magic bytes beat a declared MIME type
A data URL can claim one media type while carrying another. The declared MIME is shown as a hint, but a recognized byte signature controls the detected result and filename extension. A disagreement is displayed clearly.
Signature matching identifies a format; it does not fully parse the file. For PNG, JPEG, GIF, PDF, ZIP, WebP, and WAV, the tool also checks a known end marker or declared container length and warns when the bytes appear truncated. Other formats are marked as not fully checkable.
Local previews without executing pasted markup
Recognized raster images use a temporary Blob URL, PDFs use the browser PDF viewer, and likely UTF-8 text is inserted with textContent. HTML, XML, JSON, RTF, and SVG source is never injected as active page markup.
ZIP files, fonts, audio, video, executables, and unknown binary data are identified when possible and offered for download rather than executed. Temporary object URLs are revoked when results are replaced, cleared, or the page closes.
Privacy and realistic safety limits
Decoding, signature checks, previews, and download creation happen inside this browser tab. There is no upload, account, server conversion, or remote URL fetch.
Base64 decoding and magic-byte detection are not antivirus scanning. Treat unknown files as untrusted, scan them with your normal security tools, and do not enable macros or run recovered programs merely because the extension looks plausible.
Common failures this tool explains
- Characters outside the Base64 alphabets, mixed standard and URL-safe symbols, or padding in the wrong position.
- An unpadded length with remainder 1, which cannot be repaired into complete Base64 groups.
- A recognized header whose expected trailer or container length is missing, suggesting truncated data.
- Valid bytes with no recognized signature; they remain application/octet-stream and download as .bin.
Equivalent commands
Use the runtime or shell already available in your workflow. Validate untrusted input and keep binary output out of terminals.
Python
from pathlib import Path
import base64
Path('decoded.bin').write_bytes(base64.b64decode(value, validate=True))
JavaScript
import { writeFileSync } from 'node:fs';
writeFileSync('decoded.bin', Buffer.from(value, 'base64'));
Shell
base64 --decode payload.base64 > decoded.bin
file decoded.bin
Standards and official references
Decode Base64 file FAQ
How do I decode Base64 into a file?
Paste the encoded value, choose Decode file, review the detected type, then download the original decoded bytes.
Can it detect the original file extension?
It can infer an extension for recognized signatures, but Base64 does not preserve the original filename and signature detection cannot identify every format.
Does it support Base64URL and missing padding?
Yes. The URL-safe - and _ alphabet is normalized, and zero, one, or two trailing padding characters are added when the length permits.
Can it tell whether a Base64 file is truncated?
It rejects structurally impossible Base64 and checks end markers for several formats. Other valid Base64 payloads can still contain incomplete files, so an unknown integrity result is not a guarantee.
Which files can I preview?
Raster images, PDFs, and likely UTF-8 text can be previewed. Active HTML, XML, SVG, scripts, archives, fonts, and executables are not run.
Is the Base64 file uploaded?
No. The value is decoded and inspected locally in your browser, and the download is created from a temporary Blob URL.