πŸ”¨ All in one Utilities

Data URL to File Converter

Great utilities that help you design, program and maintain your website

utilities for you to make a website
Home » Utilities » Data URL to File Converter

Data URL to File Converter

Base64 and percent-encoded payloads both work. Line breaks are ignored.
Without the extension β€” that is added from the detected type.
Preview of the decoded file
Declared type
Detected type
Encoding
Decoded size
URL length
File name

Note: The media type written into a data URL is only a claim. The extension used here comes from the file's own signature, so if the two disagree the detected one is almost always right and whatever produced the URL was labelling everything generically.

A data URL carries a whole file inside a string: a media type, an optional charset, an optional base64 marker, and then the payload. This converter runs that backwards β€” it reads the parts, decodes the payload into bytes, and hands you a real file with a sensible extension.

The extension is the part worth doing carefully. The media type in the URL is a claim, and it is wrong often enough to matter, particularly with strings that have been through a copy-paste chain or a tool that defaults everything to application/octet-stream. The bytes themselves are not a claim, so the file signature is read and the extension comes from that instead, with the declared type shown alongside so you can see when the two disagree.

Not every data URL is Base64. Without the base64 marker the payload is percent-encoded text, which is the common form for inline SVG in a stylesheet, and it needs decoding differently. Both are handled, and if the string was wrapped across lines by an editor or an email client the whitespace is dropped before decoding rather than causing a failure.

Everything is decoded with the browser's own APIs and turned into a blob locally. There is no upload step, which matters because data URLs frequently contain exactly the kind of thing you would not want to hand to a stranger's server β€” a signature capture, a scanned document, an internal diagram pulled out of a page's source.

Frequently Asked Questions

Why does the downloaded file have a different extension than I expected?

Because the extension comes from the file's actual signature rather than the media type written in the URL. When those disagree the declared type is shown next to the detected one β€” usually it means whatever produced the URL labelled it generically, and the detected type is the one to trust.

My data URL has no base64 in it. Is it broken?

No. A data URL without the base64 marker holds percent-encoded text, which is how inline SVG is normally written into CSS because it stays readable and compresses better than Base64. It is decoded here the same as any other.

Is there a size limit?

Browsers no longer cap data URL length meaningfully, so the limit is memory. Very large strings become slow in the textarea long before decoding is a problem β€” the practical ceiling on a desktop browser is somewhere around 50 MB of string.

Is anything uploaded?

No. Decoding uses atob and Blob in your browser and the download is created from an object URL that exists only in this tab. The page works with the network disconnected, which is the easiest way to confirm it.

Related Utilities