Input (Base64 or Data URI)

Download

Paste a valid Base64 or Data URI string in the left editor to enable download.

Base64 to File Examples

Paste a Base64 string or Data URI to download the original file. Example input (a plain text file):

Data URI input

Input

Click Sample above to load the example and try downloading it.

What Is Base64 to File?

Somebody pasted an attachment into a JSON payload, or an API handed you a PDF as one long line of text. This page turns that text back into the real file and lets you save it. You can give it a bare Base64 string or a complete Data URI such as data:application/pdf;base64,.... With a Data URI the prefix already names the content type, so the page picks it up for you; a bare string carries no such hint, which is why there is a MIME type field to fill in.

Base64 is defined by RFC 4648. The tool also accepts Base64url (using - and _) and handles missing = padding automatically. Decoding and building the file both happen on your machine, so a contract or a scanned ID card pasted here is never uploaded. Going the opposite direction? Use File to Base64.

How to Use This Tool

1

Paste Your Base64 or Data URI

Put the encoded text in the left-hand editor; Sample loads one if you want to try the flow first. You do not have to say which kind of input it is: the page tells a data: URI apart from a plain Base64 string by itself.

2

Set File Name and MIME Type

Type the name the saved file should get, extension and all (for example document.pdf). A Data URI fills in the content type on its own. For a plain Base64 string, type it yourself, such as image/png or application/pdf.

3

Download

Click Download File to save the decoded file to your device. The detected file size is shown before downloading. To encode a file to Base64, use File to Base64.

Supported Input Formats

This tool handles three input formats:

Input formats

When the input is a Data URI, its prefix supplies the content type and you only need a sensible extension on the file name. A plain Base64 string arrives with no label at all, so typing the content type yourself is what tells the browser whether it is saving a PNG, a ZIP or something else.

Frequently Asked Questions

Is my data private?

Yes. The Base64 is decoded and the file assembled right here in the tab, so nothing you paste is uploaded. Keep the Network tab of your developer tools open while you click Download File if you want to watch that for yourself.

What file types can I recover?

Any file type: images (PNG, JPG, SVG, WebP), documents (PDF, DOCX), audio (MP3, WAV), video (MP4), fonts (TTF, WOFF), archives (ZIP), and any other binary format. The key is specifying the correct MIME type and file extension so the browser downloads it correctly.

What should I enter for the MIME type?

The ones that come up most: image/png, image/jpeg, application/pdf, audio/mpeg, video/mp4, text/plain, application/zip. You can skip the field entirely when you pasted a Data URI, because its prefix already says. With a plain string, pick the type that matches whatever the file originally was. If yours is not listed, MDN keeps a longer table of common MIME types.

Do I need to add = padding to my Base64 string?

No. The tool automatically calculates and adds any missing = padding. It also accepts Base64url format (with - and _ characters).

Can I turn a file into Base64 here too?

Not on this page, which only decodes. The File to Base64 page does the encoding: pick a file and it prints the Base64 or a Data URI. For pictures, use Image to Base64 which generates ready-to-use Data URIs.

Related Tools

For the Base64 specification, see RFC 4648. MDN's Data URIs guide covers the Data URI format. Blob API is used to construct the downloadable file.