Base64 to File

Decode Base64 to file and download. Paste a Base64 string or data URL below; we detect the file type and show a preview when possible. Free, no signup, runs in your browser. Your data never leaves your device.

You can paste raw Base64 or a full data URL (e.g. data:image/png;base64,...). File type is detected automatically.

Preview

Preview will appear here when you paste Base64 or a data URL.

How to convert Base64 to file

  1. Paste your Base64 string or full data URL into the text area. A data URL looks like data:image/png;base64,iVBORw0....
  2. Optionally enter a filename for the download. If you use a data URL or valid raw Base64, the tool detects the file type and suggests a name (e.g. image.png, document.pdf).
  3. A preview appears for images and PDFs so you can confirm before downloading. Click Decode & download to save the file.
  4. All decoding and preview run in your browser; no data is sent to any server. For the opposite conversion, use our File to Base64 tool.

Use this tool to recover a file from a Base64 string, embed data URLs in HTML/CSS, or verify encoded content. Supported types include images (PNG, JPEG, GIF, WebP), PDF, and more; the rest download as binary with an auto-detected or custom filename.

What is Base64?

Base64 is a way of writing binary data, such as an image or a PDF, using only ordinary text characters: letters, digits, plus, slash, and sometimes an equals sign at the end. Because the result is plain text, it can travel safely through systems built for text, such as JSON, email, HTML, and CSS. It is an encoding, not encryption: anyone can decode it, so it does not hide or protect the content. It also makes data about one third larger than the original file.

How the file type is detected

  • If you paste a data URL, the type is read from the part before the comma, for example data:application/pdf;base64,.
  • If you paste raw Base64 with no header, the tool decodes it and looks at the first bytes of the file, which identify common formats such as PNG, JPEG, GIF, WebP, PDF, and ZIP.
  • If the type cannot be recognised, the file is saved with a generic .bin extension. In that case, type your own filename with the right extension in the optional filename box.

When this is useful

  • An API returned a file as a Base64 string and you want to open it.
  • You found an image embedded in a stylesheet or web page as a data URL and want the original file.
  • You want to check that an encoded value really decodes into the file you expect before using it in your application.

Troubleshooting and FAQ

The tool says the Base64 is invalid. What can I do?
Make sure you copied the whole string with no missing characters. Line breaks and spaces are usually fine, but a truncated string will not decode. If you copied a data URL, include everything after the comma as well.
The downloaded file will not open.
The extension may be wrong. Enter a filename with the correct extension, such as report.pdf, and download again.
Is my data uploaded?
No. Decoding and previews happen in your browser, and nothing is sent to a server.