How to use the Data URL to image tool
- Copy the whole data URL, from data: to its last character, and paste it into the Base64 or Base64 data URL box.
- Select Decode image. Select Example to see the tool work on a small PNG data URL.
- Read the size and media type in the Result box and check the preview below it.
- Select Download to save the image file to your device.
How data URL to image conversion works
An image data URL has a fixed layout: the scheme data:, a media type such as image/png, the marker ;base64, a comma, and then the file itself written in Base64. The tool finds the marker, discards everything up to the comma and decodes the rest. Extra parameters between the media type and the marker are tolerated, and the prefix is matched without regard to letter case.
The decoded bytes are then checked against the signatures of PNG, JPEG, GIF and WebP. The matching format sets the file extension and the type shown in the Result box.
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...
Result: 79 bytes · image/png
File: decoded.pngThe media type in the URL is not trusted
The label in front of the comma is written by whoever built the URL, and it can be wrong. This converter ignores it. A URL that claims image/jpeg but holds PNG bytes is reported as image/png and saved as decoded.png.
The download contains the original bytes. Nothing is drawn to a canvas or compressed again, so there is no quality loss, and embedded metadata such as color profiles or EXIF data is still in the file.
Data URLs this tool cannot convert
Some inputs fail by design. The first three give the message Enter valid Base64 or Base64URL data; the last two say that the Base64 does not contain a supported image format.
- A URL without the ;base64 marker, where the content is percent-encoded text.
- A URL still wrapped in CSS url("..."), in quotes or in a src= attribute. Paste from data: onward only.
- A URL shortened for display. Developer tools often show long attribute values with an ellipsis; use the copy command instead of selecting the visible text.
- SVG data URLs. Vector images are not among the four supported formats.
- Non-image content such as data:application/pdf. Use the matching file decoder for those.
Where image data URLs come from
The canvas method toDataURL() returns a PNG data URL by default, and FileReader.readAsDataURL() produces one for any file a user selects. Bundlers inline small images into CSS and JavaScript as data URLs. Rich text editors and HTML emails embed pasted pictures the same way.
Turning such a URL back into a file is useful when you want to inspect an inlined asset, run it through an optimizer, attach it to a bug report or host it as a normal cacheable image.
Frequently asked questions
How do I save a data URL as a PNG file?
Paste the complete data URL into the box and select Decode image. When the bytes are a PNG, the Download link saves them as decoded.png. JPEG, GIF and WebP content is saved with its own extension.
Does converting a data URL change the image quality?
No. The tool decodes the Base64 and hands you those bytes as a file. The pixels are never re-encoded, so the download is identical to the image that was originally embedded.
Why does a data URL copied from CSS give an error?
CSS wraps the URL in url() and usually in quotes, and those characters are not Base64. Remove everything before data: and the closing quote and parenthesis after the last character of the payload.
Does it work with Base64 that has no data: prefix?
Yes. The prefix is optional, and a bare Base64 string is decoded the same way. The format is always decided by the decoded bytes, so no media type is needed.
Is my data URL uploaded anywhere?
No. The conversion is done by JavaScript in this page, and the preview and download are built from memory in your browser. The picture never crosses the network.