Base64 to File
Decode a Base64 string into any file type with automatic format detection, or encode any file to Base64 — free, in your browser.
Base64 to any file, and back
A Base64 string carries no metadata about what it decodes to — no extension, no MIME type. This tool decodes the bytes and identifies the format from its own magic-byte signature, then offers a type-aware preview (image, PDF, or text) alongside a download with a sensible file name.
It's the general-purpose counterpart to the dedicated Base64 to Image and Base64 to PDF tools — useful when you don't know in advance what the Base64 actually contains.
How to convert Base64 to a file
- On the Base64 → File tab, paste the Base64 string — the format is detected automatically.
- Adjust the file name if needed, then download.
- On the File → Base64 tab, drop or upload any file to get its Base64 output.
Frequently asked questions
How does this figure out the file type without an extension?
Common binary formats (PNG, JPEG, GIF, WebP, BMP, ICO, PDF, ZIP, GZIP, MP4, WAV, MP3) are detected from their own magic-byte signature. If none match, the bytes are checked for valid UTF-8 text, and then for JSON or SVG shape, before falling back to a generic binary download.
Can I rename the file before downloading?
Yes — edit the file name field next to the Download button; it starts pre-filled with a detected extension.
What if the format isn't recognized at all?
It still downloads as raw bytes with a .bin extension and an 'Unknown binary data' label — nothing is lost, it just won't get a type-specific preview.
Is there a dedicated tool for images or PDFs specifically?
Yes — Base64 to Image and Base64 to PDF give a larger, type-focused preview for those two formats specifically. This tool is the general-purpose fallback for anything else.
Can I encode any file to Base64 here too?
Yes — the File → Base64 tab accepts any file by drag-and-drop or upload, with an optional URL-safe alphabet.