Photos & videos are never uploaded or stored.

Why?
BROWSER CAMERA

Base64 to Image Decoder

Paste a Base64 string or data URI and see the image instantly, with the real file type detected and a one-click download. It even finds every embedded image in a block of HTML, CSS or JSON.

Result

The image appears as soon as you paste. The file type is read from the decoded bytes, not from the label.

Updated

Decode Base64 to an image

Paste into the box above:

  • a data URI: data:image/png;base64,iVBORw0KGgo…
  • raw Base64: /9j/4AAQSkZJRgABAQ…
  • or a whole HTML, CSS, JSON or Markdown snippet that contains data URIs

The image appears as soon as you paste, with its real format, dimensions and size. Click Download image to save it, or Download all as ZIP when there are several.

The decoder is forgiving

Base64 copied from code, logs and emails is often messy. The decoder handles:

  • Line breaks and spaces inside the text (common in emails and PEM-style output)
  • URL-safe Base64 using - and _ instead of + and /
  • Missing = padding at the end
  • Quotes around the value
  • Non-Base64 data URIs such as URL-encoded SVG (data:image/svg+xml,%3Csvg…)

The real format, not the label

Data URIs state a MIME type, but it can be wrong: a JPEG labelled image/png, or application/octet-stream. This tool reads the file signature of the decoded bytes (the "magic numbers" at the start of every file) and identifies JPG, PNG, WebP, AVIF, GIF, BMP, ICO, TIFF, HEIC, SVG and PDF. The download gets the correct extension, and a mismatched label is pointed out.

Find every image in a page or file

Paste a complete HTML email, a stylesheet, an API response or a JSON export: every data:image/… URI is found and decoded, shown as a gallery and downloadable as a ZIP. Handy for extracting icons from a CSS file, images from a saved HTML email, or debugging an API that returns Base64 images.

What is Base64?

Base64 writes binary data with 64 text characters (A–Z, a–z, 0–9, + and /), 4 characters for every 3 bytes. It's used to carry images inside text formats: HTML, CSS, JSON, XML, emails. Decoding reverses it exactly: the downloaded file is byte-for-byte the original.

To encode an image, use Image to Base64.

Private by design

Base64 strings often come from internal systems, emails and API responses. They're decoded here in your browser, on your device, and never sent anywhere.

Frequently asked questions

How do I convert Base64 to an image?

Paste the Base64 text or data URI into the box. The image appears immediately; click Download image to save it with the correct file extension.

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

No. Raw Base64 works too. The file type is detected from the decoded bytes either way.

How is the file type detected?

From the decoded data itself (the file signature), not from the label. If a data URI says image/png but the bytes are actually JPEG, you get a .jpg and a note about the wrong label.

Can it decode several images at once?

Yes. Paste a whole HTML page, CSS file, JSON response or Markdown document and every data URI in it is decoded. Download them one by one or all as a ZIP.

What Base64 variants work?

Standard Base64, URL-safe Base64 (with - and _), text with line breaks or spaces, and strings with missing = padding.

Why do I get an "invalid Base64" error?

The text contains characters that are not part of Base64, for example a cut-off string, quotes, or HTML around it that is not a data URI. Paste only the Base64 part, or the complete data URI.

Which image formats can it output?

Whatever the data contains: PNG, JPG, WebP, AVIF, GIF, BMP, ICO, SVG, TIFF, HEIC, even PDF. Formats your browser can't display (like TIFF in Chrome) can still be downloaded.

Is my data sent anywhere?

No. Decoding happens in your browser on your device. Nothing is uploaded.

Can I open a text file with Base64 in it?

Yes. Use Or open a text file to load a .txt, .html, .css, .json or similar file from your device.

How do I convert an image to Base64?

Use Image to Base64 for data URI, HTML, CSS and Markdown code.

Related tools