About this tool
Turn Base64 strings or data URLs into downloadable files.
Base64 to File decodes a Base64 string or a data: URL back into the original bytes, identifies what the file actually is by reading its magic number, and saves it with the correct extension. It checks more than 30 signatures — PNG's 89 50 4E 47, JPEG's FF D8 FF, PDF's %PDF-, the ZIP local-file header PK\x03\x04 and others — so a payload with a wrong or missing MIME type is still saved correctly. It is for developers pulling attachments out of API responses, logs and database rows.
Open Base64 to File on AltFTool — it loads instantly in your browser.
Paste the payload into the Base64 payload or data URL box; the bytes are decoded in this tab and the type is read from the magic number, so there is no format to pick.
Check the Decoded payload panel — Detected type, MIME type, Decoded size, Base64 length, First 8 bytes, Byte-order mark, Entropy, Declared media type and Suggested file name, plus a Text preview of the first 240 characters when the payload is text.
Set a name in File name (extension is added for you), then click Save file to download it, Copy as data URL to copy the payload with its detected MIME type, or Reset to go back to the sample.
The extension comes from the file signature, not from the sender's Content-Type header.
If the data: URL claims application/pdf but the bytes are a PNG, the tool says so.
A reading at or above 7.5 bits/byte tells you the payload is already compressed or encrypted.
Paste the Base64 (with or without the `data:…;base64,` prefix) and press Save file. Every 4 Base64 characters become 3 bytes per RFC 4648, and the extension is chosen from the decoded file's magic number — so a PNG is saved as .png even if nothing in the string said so.
Over 30, including PNG, JPEG, GIF, WebP, BMP, TIFF, ICO, PDF, ZIP (and the .docx/.xlsx/.pptx/.odt/.epub files built on it), GZIP, BZIP2, 7z, RAR, TAR, MP3, WAV, FLAC, OGG, MP4, WebM, MIDI, WOFF/WOFF2/TTF/OTF fonts, SQLite databases, ELF and Windows executables. Anything unmatched but valid UTF-8 is treated as text; the rest is saved as .bin.
Base64 encodes 3 bytes as 4 characters, a fixed 33.3% increase, plus up to 2 padding characters and any line breaks. A 1 MB file becomes about 1.37 MB of Base64, which is why it is a transport format rather than a storage format.
No. Decoding, type detection and the download all run in your browser tab using client-side JavaScript; the payload is never sent to a server, which matters when the file is a signed document or a private key export.
Add the Base64 to File widget to your blog or website — free, responsive, no signup. Just keep the “Widget by AltFTool” credit link visible.
<iframe src="https://www.altftool.com/embed/widget/base64-to-file"
title="Base64 to File — free AltFTool widget"
width="100%" height="640" style="border:0;border-radius:12px;overflow:hidden"
loading="lazy" referrerpolicy="no-referrer-when-downgrade" allow="clipboard-write"></iframe>
<p style="font-size:12px;margin:4px 0 0">Widget by <a href="https://www.altftool.com/tools/all/base64-to-file?utm_source=embed&utm_medium=widget" rel="nofollow">AltFTool — free online tools</a></p>