My Tool Studio
Image

Base64 to Image Converter

Paste a Base64 string or a full data URI and this Base64 to image converter shows the picture straight away, then lets you save it as a file. It reads the first bytes of the decoded data to find the real format, so a PNG is saved as .png, a JPEG as .jpg, and GIF, WebP, SVG, BMP, ICO and AVIF get the right extension too. You see the MIME type, pixel dimensions and file size, can convert to PNG, JPG or WebP, copy the image to the clipboard and choose the file name. Messy input is cleaned up automatically, several images in one paste are split and offered as a ZIP, and you can open a .txt or .json file instead of pasting. Decoding happens in your browser.

Always freeNo sign upRuns in your browser

Pasting decodes straight away. Several data URIs, or one Base64 string per line, decode as separate images.

Need the reverse? Convert an image to Base64.

How to use

01

Paste or open the Base64 data

Paste a raw Base64 string or a data URI into the box, and it decodes at once. You can also click Open .txt file, or Try sample for an example.

02

Check the image details

The image appears with its format, MIME type, dimensions and file size. A warning shows if the declared type does not match the actual bytes.

03

Download, convert or copy

Set a file name, then click Download to keep the original format, Save as PNG, JPG or WebP to convert, or Copy image. Several images come as a ZIP.

Why Base64 to Image Converter

Base64 prefixes and the formats they indicate

Every file format starts with a few signature bytes, so each one has a recognisable Base64 prefix. You can often tell the type at a glance before decoding anything. The prefixes below apply to raw Base64 and to the part after the comma in a data URI. A string that starts with none of them may be a less common format, or data that has been encrypted or compressed.

Base64 starts withDecoded signatureFormat
iVBORw0KGgo\x89PNGPNG
/9j/\xFF\xD8\xFFJPEG
R0lGODGIF8GIF
UklGRRIFFWebP (a RIFF container)
PHN2Zy<svgSVG
PD94bWwg<?xmlXML, often SVG
QkBMBMP
AAABAA00 00 01 00ICO
JVBERi0%PDF-PDF (not an image)
UEsDBPKZIP, DOCX or XLSX (not an image)

Troubleshooting a Base64 image that will not decode

When a string refuses to decode, the problem is almost always in how it was copied, not in the image itself. Work through these checks in order.

  • Truncated data: the string was cut off by a log viewer, a database column limit or a copy that did not include everything. Copy it again from the source, or export it to a .txt file and open that here.
  • Wrong content: the value is a URL, a file path or an ID, not Base64 data.
  • Double encoding: the data was Base64 encoded twice. Decode it once as text, then paste the result here.
  • Mixed strings: extra fields were pasted with the data. Several complete data URIs are split automatically, but other text in between can confuse detection.
  • Not an image: the bytes are a PDF, ZIP or other file. The tool reports PDFs directly and warns when it cannot detect an image type.

Common questions

How do I convert Base64 to PNG or JPG?
Paste the string and the image decodes straight away. Click Download to keep the original format, or Save as PNG or Save as JPG to convert it. JPG conversion fills transparent areas with white.
Do I need the data:image prefix to decode a Base64 image?
No. Raw Base64 works too, because the tool detects the image type from the decoded bytes. If you paste a data URI, its declared type is compared with the real one, and you are warned if they differ.
Can I decode several Base64 images at once?
Yes. Paste text that contains several data URIs, or put one Base64 string per line. Each one is decoded separately, shown as a thumbnail you can click, and Download all saves them together in a ZIP.
Why does my Base64 image not display?
The most common causes are a string cut off during copying, extra text mixed into the data, or data that is not an image at all, such as a PDF. The tool flags strings whose length shows they were cut off, and data that decodes to a different file type. See the troubleshooting list below for more checks.
How can I tell what file type a Base64 string is?
Look at the first characters. iVBORw0KGgo is PNG, /9j/ is JPEG, R0lGOD is GIF and UklGR is a RIFF file such as WebP. This tool checks the decoded bytes and shows the format and MIME type for you.
Can I decode URL-safe Base64 images?
Yes. URL-safe Base64 uses - and _ instead of + and /, and often drops the = padding. The tool converts those characters and adds padding before decoding.
Can I decode a Base64 SVG?
Yes. SVG is detected from its text and saved as .svg. Because SVG is a vector format, the size shown depends on the width and height set inside the file, and converting it to PNG uses that size.
What if my Base64 decodes to a PDF instead of an image?
The tool recognises the PDF signature and tells you it is not an image. Use a Base64 to PDF decoder for those files.
Is the Base64 data sent to a server when I decode it?
No. Decoding, format detection, preview, conversion and copying all run in your browser. The data never leaves the page.

More Image tools

View all