Base64 to File Downloader
Base64 Input
Download File
Paste a Base64 string on the left, then download your file
Ready to download
What is Base64 to File Conversion?
When working with APIs, emails, or data stores that encode binary files as Base64 strings, you sometimes need to recover the original file. This tool decodes any Base64 string and lets you download it as a proper file: choose the MIME type and file name, then click Download.
The tool accepts raw Base64 strings and full Data URIs (e.g. data:application/pdf;base64,...). If a Data URI is detected, the MIME type is auto-filled. The RFC 4648 Base64 standard is fully supported.
All decoding happens in your browser using the native atob() API and the Blob API. Nothing is uploaded to our servers.
How to Use the Base64 to File Downloader
The string is decoded as you paste it, and the right panel reports the decoded size and MIME type before anything touches your disk. Saving only happens when you ask for it.
Paste, Upload, or Load Sample
Paste Base64 into the left Base64 Input panel. If it's a full data URI (data:application/pdf;base64,...), the MIME type is taken from it; for raw Base64, PDF, PNG, JPEG, GIF, WebP, ZIP, MP3 and MP4 are recognised from the first bytes. Click Sample to load example PDF Base64.
Set File Name and Type
Enter a file name (e.g. subscriber_bill.pdf) and select the MIME type from the dropdown. For unusual types, select Custom and enter the MIME string manually.
Download File
Click Download File once the panel shows a size and type. If the name you typed has no dot, an extension is added from the MIME type (.pdf, .png, .docx and so on, or .bin for a custom type). Pressing the trash-can icon empties the input and puts the name back to decoded-file and the type back to PDF.
When You'd Actually Use This
API Response File Recovery
When REST APIs (OpenAPI) return files as Base64 in JSON (such as generated reports, invoices, or signed contracts) decode and save them here without writing any code.
MIME Email Attachment Extraction
Extract file attachments from raw MIME emails (RFC 2045). Copy the Base64-encoded attachment body section and download it as the original file type.
Kubernetes Secret Extraction
Kubernetes Secrets store files as Base64. Decode TLS certificates, private keys, or configuration files stored in cluster secrets.
Database BLOB Recovery
Databases like PostgreSQL and MySQL return binary columns as hex or Base64 in JSON exports. Recover files stored in BLOB columns directly from query results.
Common Questions
How do I know which MIME type to use?
If the Base64 comes from a data URI, the MIME type is read from it, and raw Base64 of a PDF, PNG, JPEG, GIF, WebP, ZIP, MP3 or MP4 is recognised from its first bytes. Otherwise, check the API documentation or the original file extension. The IANA media types registry is the authoritative source for MIME types.
What happens if I choose the wrong MIME type?
The file will still be downloaded with the binary data intact, only the label changes. You can rename the file extension and open it with the correct application. The actual encoded data is unaffected.
Is my data private?
Yes. All decoding uses the browser's atob() and Blob APIs. Nothing is sent to our servers: your encoded data stays entirely on your device.
How do I convert a file to Base64?
Use our File to Base64 tool: upload any file and get the Base64 string. This tool is the reverse operation.
Can I decode URL-safe Base64 (Base64url)?
Yes! The tool automatically normalizes URL-safe Base64 (with - and _) to standard Base64 before decoding, so it works seamlessly with JWTs and OAuth tokens.
What if my Base64 has extra whitespace?
The tool automatically strips whitespace from the input before decoding. Spaces, tabs, and newlines are safely ignored.
Related Base64 Tools
Complete your Base64 workflow: