Base64 to File Downloader
Decode any Base64 string and download it as a file — PDF, images, ZIP, DOCX, and more
Base64 Input
Download File
Paste a Base64 string on the left, then download your file
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
Follow these steps to decode Base64 and download as a file. Each step uses the actual buttons and panels on this page.
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 auto-detected. 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 to save the decoded binary. Use Clear to start fresh. All decoding runs in your browser.
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 auto-detected. 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: