Base64 to Image: Decode and Download (Free Online)

RunFreeTools TeamJun 17, 20264 min read

You found a long string starting with data:image/png;base64,... in a stylesheet, an API response or an email source, and you want to see the actual picture and save it. Decoding Base64 back into a real image file makes that easy. This guide explains how Base64 data URIs work, how to turn one back into a viewable file, and how to do it with the free in-browser Base64 to Image tool. Everything is decoded locally, so your data never leaves your device.

How Base64 images and data URIs work

Images are binary, but Base64 represents that binary data as plain text using 64 safe characters. A data URI wraps the Base64 text with a header so software knows it is an image. The full form looks like data:image/png;base64, followed by a long run of letters, numbers, plus signs and slashes.

The header tells the decoder two things: the media type (such as image/png or image/jpeg) and that the payload is Base64. To recover the original picture, a decoder reverses the process — it reads the text, converts each group of 4 characters back into 3 bytes, and reconstructs the exact original file, pixel for pixel. Decoding is lossless, so the image you get back is identical to the one that was encoded.

The Base64 to Image tool accepts either a full data URI or just the raw Base64 characters, figures out the format, and renders a preview you can download.

How to use the Base64 to Image tool

Decoding takes only a moment:

  1. Open the Base64 to Image tool.
  2. Paste your Base64 string into the box. You can paste the full data URI (starting with data:image) or just the encoded characters.
  3. The tool decodes the string in your browser and shows a live preview of the image.
  4. Confirm it looks right, then click download to save it as a real image file.
  5. The file is saved with the correct extension based on the detected format.

All of this happens on your device, so even sensitive embedded images stay private.

A concrete example

Say you copied this from a CSS file: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA... The tool reads it like this:

  • Input: a data URI beginning with data:image/png;base64,
  • Detected format: PNG (from the header)
  • Output: a preview of the decoded picture
  • Download: a .png file saved to your device

If you paste a string that begins with /9j/ instead, that is the signature of a JPEG, and the tool will produce a .jpg file. The general flow is always the same:

You paste Tool detects You get
data:image/png;base64,iVBOR... PNG a .png download
data:image/jpeg;base64,/9j/... JPEG a .jpg download
raw characters, no header best-guess format a downloadable image

When you need to decode Base64 images

Turning Base64 back into a file is handy in many workflows:

  • Inspecting an inline image you found in HTML, CSS or an email template and want to save.
  • Pulling an image out of a JSON or API response that returns pictures as Base64.
  • Debugging a data URI to confirm it actually encodes the image you expect.
  • Extracting an embedded logo or screenshot from a self-contained document.

Once you have the file, you can keep working with it: shrink it with the Image Compressor or change its format with the Image Converter. If you instead need to go from a file back to Base64, the companion Image to Base64 tool does the reverse.

Tips and common mistakes

A few pointers for clean decoding:

  • Paste the whole string. Base64 strings are long; if you cut one off partway, the result will be corrupted or blank. Copy the entire value, including the final characters.
  • The header is optional but helpful. A full data URI tells the tool the exact format. Raw characters still decode, but the format is inferred.
  • Watch for stray spaces or line breaks. Some sources wrap the string across lines; extra whitespace can sometimes break decoding, so remove it if the preview fails.
  • Do not confuse Base64 with a URL. A normal https link to an image is not Base64 — this tool is for the long data:image strings, not for web addresses.
  • If nothing shows up, the string may not be a valid image, may be truncated, or may be a different kind of Base64 data (such as text or a PDF).

Privacy: decoded entirely in your browser

This decoder works completely on your device. When you paste a Base64 string, it is converted back into image bytes locally in your browser and rendered as a preview — the string is never sent to a server, saved or logged. That means private screenshots, internal assets and confidential graphics embedded as Base64 stay on your machine.

The tool is free, with no sign-up and no watermark on your downloads. Browse more free image tools, or see everything available on the all tools page for compressing, converting and editing your pictures.

Try the tool from this guide

Base64 to Image

Decode Base64 back to an image.

Open Base64 to Image

Frequently asked questions

Is the Base64 to Image decoder free?

Yes, it is completely free with no sign-up and no watermark. You can decode and download as many images as you need.

Is my data uploaded when I decode it?

No. The Base64 string is decoded entirely in your browser on your own device. Nothing is sent to a server, stored or logged, so embedded images stay private.

Do I need the full data URI or just the Base64 characters?

Either works. A full data URI that starts with data:image tells the tool the exact format. If you paste only the raw characters, the tool infers the format and still produces a downloadable image.

What image formats can it output?

It detects the format from the string and saves the correct type, commonly PNG or JPG, and also formats like GIF and WebP when the header indicates them.

Why is my image blank or corrupted after decoding?

The most common cause is a truncated or partial string. Make sure you copied the entire Base64 value, and remove any stray line breaks or spaces, then try again.

Sources

Share this article

Send it to a teammate or save the link for later.

Related tools

A mailbox receiving new tools, guides and feature updates

New tools, straight to your inbox

A short note whenever we ship a new free tool or guide. No spam, unsubscribe in one click.

  • No spam
  • Unsubscribe anytime
  • Your email is safe
4min left