BF

Base64 to File Decoder

Paste a Base64 string or data URL and download the decoded file.

Paste a raw Base64 string or a full data URL (data:mime/type;base64,...) to decode and download the original file. Everything runs locally in your browser.

What is Base64 to File decoding?

Base64 decoding is the reverse of encoding — it converts a Base64 text string back into the original binary data. If you have received a Base64-encoded file inside a JSON payload, an email attachment, or an API response, this tool lets you decode and download it as the actual original file.

The tool supports both raw Base64 strings and complete data URLs in the format data:mime/type;base64,... When a data URL is pasted, the MIME type and suggested file extension are detected automatically from the prefix.

How to use this tool

Paste your Base64 string or full data URL into the input. If you paste a data URL, the MIME type is read automatically and a matching file extension is suggested. For a raw Base64 string, choose the correct file type from the dropdown so the downloaded file opens in the right application.

Enter a filename, then click Decode and Download. The decoding runs entirely in your browser using the built-in atob function — no data is sent to any server.

About this tool

Turn Base64 back into a real file

This Base64 to file converter decodes a Base64 string or a data: URL and downloads the original file. Use it when an API, JSON payload, database field or email gives you a file as text and you need the actual PDF, image or document.

How to decode Base64 to a file

  1. Paste the Base64 string or the full data URL (for example data:application/pdf;base64,JVBERi0...). Spaces and line breaks are removed automatically.
  2. If you pasted a data URL, the file type is detected for you. For a raw string, choose the file type from the list.
  3. Enter a file name without the extension.
  4. Click Decode & Download.

Supported file types

The correct extension is added for 29 common types, including:

  • Documents: PDF, DOCX, DOC, XLSX, PPTX, TXT, CSV, JSON, XML, HTML
  • Images: PNG, JPG, GIF, WebP, SVG, BMP, ICO
  • Audio and video: MP3, WAV, OGG, MP4, WebM
  • Other: ZIP, JavaScript, CSS, TTF, WOFF, WOFF2

Any other data downloads as a generic .bin file.

How to tell what file a Base64 string contains

The first characters often reveal the type: JVBERi is a PDF, iVBORw0KGgo is a PNG, /9j/ is a JPEG, R0lGOD is a GIF and UEsDB is a ZIP-based file (ZIP, DOCX, XLSX or PPTX).

Private and fast

Decoding happens in your browser, so the file is never uploaded to a server — safe for invoices, IDs and other private documents.

Frequently asked questions

Why does it say the input is not valid Base64?

The string may be cut off, contain characters outside the Base64 alphabet, or be URL-safe Base64 (using - and _). Copy the full value again and make sure nothing is missing at the end.

Can I convert a file to Base64 instead?

Yes — use the File to Base64 encoder for the reverse direction.

More to explore

Related Developer Tools

Browse all tools from the same category.

Showing 1-2 of 48