Skip to main content

Data URL Generator

New

Convert files to Base64 data URLs and decode data URLs back to files.

data-urlbase64encodefile
Read the guide
Shortcuts:⌘ KSearch
Name
Type
Size
URL length
0
Usage examples
Reverse data URL
Decoded type
Decoded size
Suggested file

Frequently Asked Questions

Can I use this for files that are not images?

Yes. The upload side reads any file with FileReader.readAsDataURL, and the reverse side decodes any matching data URL into a Blob.

Why is my data URL so huge?

That is normal. Data URLs inline the entire file, and base64 adds overhead on top of the original bytes, which is why the tool shows the final URL length explicitly.

Can it decode a pasted data URL back into a downloadable file?

Yes. It accepts both base64 data URLs and plain percent-encoded payloads, then rebuilds a Blob and enables a download button.

How does it decide the downloaded filename and extension?

It uses a small MIME-type map for common types like png, jpg, svg, json, pdf, html, and css. If the MIME type is unknown, it falls back to decoded-file.bin.

What happens if I paste a malformed data URL?

The reverse parser first checks a data:... regex and then tries to decode the payload. Invalid input shows either “Paste a valid data URL first” or a decode failure message.

Related Tools