Image Tools

Base64 to Image Converter

Paste a Base64 string or data URL to preview and download it as an image file. Runs entirely in your browser.

How it works

Paste either a full data URL (data:image/png;base64,…) or only the Base64 characters. The browser then tries to decode the text as an image: if it succeeds you are taken to a download page with a preview and the file, and if not you see an error. Nothing is re-encoded, so the saved file is exactly the decoded data.

File name and type

The download is called decoded-image with an extension taken from the image type in the data URL: .png, .jpg, .webp, .gif, .svg, .bmp or .ico, and .bin for any other type. Bare Base64 is treated as PNG, so it is saved as decoded-image.png even if the bytes are really a JPEG or GIF — paste the full data:image/jpeg;base64,… URL to get decoded-image.jpg.

Limits

Only image data works: Base64 for a PDF, audio or text file shows the error message. Unlike the file tools, there is no size check on the pasted text, so extremely long strings can slow the tab.

Telling the format from the first characters

Base64 strings for common image formats start with recognizable text. PNG files begin iVBORw0KGgo, JPEG files /9j/, GIF files R0lGOD, WebP files UklGR and SVG files that start with an svg tag and a space PHN2Zy. So a bare string starting with /9j/ is really a JPEG. Paste it with its own prefix, data:image/jpeg;base64,/9j/..., so the saved file gets the right type, since a bare string is given a PNG prefix.

What the tool does to your text

Leading and trailing spaces are removed. If the text starts with data: it is used exactly as given, and otherwise data:image/png;base64, is put in front of it. The browser then tries to load the result as an image. An empty box shows "Paste a Base64 string or data URL first," and anything that does not decode shows "That doesn't look like valid image data" and clears any earlier preview.

Limits

Because the browser's own image decoder does the work, any format it can display will preview, including SVG when pasted as a data:image/svg+xml URL. Base64 of a PDF, audio or text file will not. Paste the string on a single line without quotes or surrounding code, and expect a very long string to slow the page, since the text length is not checked.

Guide

Frequently asked questions

Does this work with a bare Base64 string, not just a full data URL?

Yes — paste either a full data:image/...;base64,... string or just the bare Base64 characters, and it will be treated as a PNG image if no format is specified.

How can I tell what format my Base64 image is?

Look at the first characters. iVBORw0KGgo means PNG, /9j/ means JPEG, R0lGOD means GIF, UklGR means WebP and PHN2Zy means an SVG that starts with an svg tag and a space.

Why does my JPEG download with a .png extension?

A bare Base64 string is given a PNG prefix. Paste the full data URL, starting data:image/jpeg;base64, to keep the JPEG type.

Why do I get the invalid image message?

The text could not be decoded as an image. Common causes are a truncated string, a different file type such as a PDF, or stray characters such as quotation marks or a trailing backslash.

Related tools