How to convert Base64 to an image

  1. Paste the Base64 into the box above. A whole data URI such as data:image/png;base64,iVBORw0… works, and so does the Base64 part on its own.
  2. The image appears straight away, with its type, dimensions and file size.
  3. Click Download to save it as a file with the right extension.

The tool recognises PNG, JPG, GIF, WebP, SVG, ICO, BMP and AVIF from the data itself, so the result is correct even when the Base64 has no data: prefix or the prefix names the wrong type. Line breaks, spaces and URL-safe Base64 (- and _) are handled automatically. Decoding happens in your browser; nothing is uploaded.

To go the other way, switch to Image → Base64, or open the Image to Base64 converter.

Where Base64 images come from

You usually meet Base64 images in places like these:

  • HTML and CSS source, as <img src="data:image/…"> or background-image: url(data:…).
  • API responses and JSON, for example screenshots, signatures, QR codes or images generated by AI services.
  • Email source code, where images are sometimes embedded instead of attached.
  • Logs and databases that store small images as text.

Paste the value here to see what it is and save it as a normal file.

How to tell which image format Base64 holds

The first few characters of the Base64 give the format away, because every format starts with the same bytes:

  • iVBORw0KGgo is a PNG.
  • /9j/ is a JPG.
  • R0lGOD is a GIF.
  • UklGR is usually a WebP.
  • PHN2Zy or PD94bWwg is an SVG (text starting with <svg or <?xml).
  • AAABAA is an ICO icon.

This converter checks these bytes for you and names the file accordingly.

Fixing Base64 that does not decode

  • "Not part of the Base64 alphabet": extra text was copied along, such as quotation marks, a CSS url( or a JSON key. Remove everything except the data URI or the Base64 itself.
  • "Looks cut off": part of the string is missing. Long values are often shortened in logs and developer tools, so copy the full value from the source.
  • Decodes but shows no image: the data is not an image, or it is damaged. If it is text or another kind of file, open it in the Base64 decoder, which can show text and download any file.

Frequently asked questions

Is the Base64 sent to a server?

No. The image is decoded and shown by your browser, so you can safely paste images from private systems.

Do I need the "data:image/png;base64," part?

No. Paste either the whole data URI or just the Base64 after the comma. The tool works out the format from the data.

Why does the downloaded file have a different extension than the data URI says?

The tool trusts the image data over the label. If a data URI says image/jpeg but the bytes are a PNG, the file is saved as .png so it opens correctly, and the difference is shown next to the type.

Can I convert Base64 to JPG or PNG specifically?

The image is saved in the format it is stored in. To change the format afterwards, open the downloaded file in any image editor, or use Compress Image to Size to save it as a smaller JPG.

Related tools