Base64 to File Converter
Turn a Base64 string or data URI back into a downloadable file. Detects the type (PNG, JPEG, PDF, ZIP, MP3 and more) from its bytes, in your browser.
APIs, databases and web pages often carry files as Base64 text: an image inside a data URI, a PDF in a JSON response, an attachment in raw email source. Paste that text here to get the original file back as a download. The tool reads the first bytes — the file's "magic number" — to recognise the format and pick the right extension, and previews images, audio and video before you save them.
How to use this tool
- Paste the Base64 text, with or without a
data:...;base64,prefix. - Optionally type a file name; the detected extension is added for you.
- Check the detected file type and size.
- Press Download to save the file.
Formula
file size = ⌊6 × c ÷ 8⌋ bytes
c is the number of Base64 characters excluding "=" padding. The type is detected by comparing the first bytes with known signatures — for example 89 50 4E 47 0D 0A 1A 0A for PNG, FF D8 FF for JPEG and 25 50 44 46 2D ("%PDF-") for PDF. A recognised binary signature takes priority over the data URI MIME type; otherwise the supplied type may be used.
Example
Every PNG begins with the same 8-byte signature, which in Base64 is iVBORw0KGgo=. Pasting just that gives an 8-byte download named decoded.png, labelled PNG by its signature; those eight bytes alone are not a complete image. Prefixes /9j/ and JVBERi0 similarly suggest JPEG and PDF. Detection does not verify the whole file.
Frequently asked questions
Is my file uploaded anywhere?
No. Decoding happens in your browser and the download is created locally, so it also works for private files.
Why does it say "Unknown binary data"?
The first bytes match none of the signatures the tool knows. The bytes are still decoded correctly — type a file name with the right extension before downloading.
Do I need to remove the data: prefix?
No. The prefix is read and its MIME type is used for the file; if it disagrees with the bytes, a note says so.
Why is my DOCX shown as a Word file but my JAR as a ZIP?
Office files and JARs are both ZIP containers. Office files list their internal folders (word/, xl/, ppt/), which the tool checks; other ZIP-based formats are reported as ZIP.
Sources
Last updated: 2026-10-30