Data URI to File Converter

Decode a base64 data URI and download the binary file

Ad placeholder (leaderboard)

The Data URI to File Converter takes a data: URI and turns it back into a real, downloadable file. Paste the string, confirm the MIME type and size, preview images inline, and save the decoded bytes — all in your browser.

How it works

A data URI follows the form defined by RFC 2397:

data:[<mime-type>][;base64],<payload>

The converter splits the string at the first comma into a header and a payload, then:

  • reads the MIME type from the header (defaulting to text/plain when absent);
  • checks for the ;base64 flag;
  • decodes the payload — base64 via the browser’s atob, or percent-decoding for text data URIs — into a byte array;
  • chooses a file extension from the MIME type using a built-in map.

The decoded bytes are wrapped in a Blob and offered as a download through a temporary object URL, which is revoked immediately after the click.

Example

The URI data:text/plain;base64,SGVsbG8h decodes to the bytes for Hello! and downloads as a .txt file. A data:image/png;base64,... string previews the image, then downloads as a .png.

Notes

This is the inverse of a base64 file encoder. It is handy for recovering assets inlined in CSS, HTML or JSON, or for extracting an image a designer pasted into a message. Because decoding and the download both happen locally, no part of the embedded file is transmitted.

Ad placeholder (rectangle)