Base64 to Image

Turn a Base64 string or data URI back into an image file. Paste the text, click Decode Image, then preview it and download the original file or a PNG or JPG copy. The real format is detected from the decoded bytes.

Decoding happens in your browser โ€” nothing you paste is uploaded.

Base64 Input

Tip: Ctrl+Enter (โŒ˜+Enter) decodes.

How to use:

  1. 1.Paste your Base64 string (with or without the data: prefix), or a piece of HTML/CSS that contains data URIs
  2. 2.Click "Decode Image" to convert
  3. 3.Preview, then download the original file or a PNG/JPG copy, or copy it to the clipboard

Recognised formats:

PNG, JPEG, GIF, WebP, BMP, ICO, AVIF and SVG preview in the browser. TIFF, HEIC and JPEG XL are recognised and can be saved, but most browsers cannot preview them. Standard and URL-safe Base64 are both accepted.

No Image Decoded

Paste a Base64 string and click "Decode Image" to preview

Summary: How to Convert Base64 to an Image Free and Privately

Base64 to image conversion turns a Base64 text string, or a data URI such as data:image/png;base64,iVBORw0KGgo..., back into a real image file. Paste the text into the Base64 Input box, click Decode Image, check the preview and click a download button. You can save the original file, a PNG or JPG copy, or copy the image to the clipboard.

Decoding runs in your browser; nothing is uploaded (you can check the Network tab in DevTools). The tool does not trust a label: it identifies the format from the first bytes of the decoded data. It accepts raw Base64, full data URIs, strings in quotes or CSS url(...), and HTML, CSS or JSON that contains several data URIs.

To go the other way, use the image to Base64 converter. For Base64 that holds text instead of a picture, use the Base64 text decoder or the Base64 encoder, and for other file types wrapped as data URLs, try the data URL converter.

Table of Use: What You Can Paste and What You Get

Accepted input forms
You haveLooks likeResult
Raw Base64iVBORw0KGgoAAAANSUhEUg...Format found from the bytes, then preview and download
Data URIdata:image/jpeg;base64,/9j/4AAQ...Decoded; a wrong label is flagged
CSS valuebackground: url("data:image/png;base64,...")The image is pulled out of the url(...)
HTML with several inline images<img src="data:image/png;base64,..."> repeatedEvery image decoded, plus a ZIP of all of them
A JSON string value with escaped slashes"\/9j\/4AAQSkZJRg..."Escapes undone, then decoded
Inline SVG that is URL-encodeddata:image/svg+xml,%3Csvg ...Saved as an .svg file
Base64 of a PDFJVBERi0xLjQ...Flagged as not an image; still downloadable as .pdf

Raw Base64 has no label, but its first characters reveal the file type because every format begins with fixed bytes:

Base64 prefixes and the formats they mean
Starts withFormat
iVBORw0KGgoPNG
/9j/JPEG
R0lGODGIF
UklGRWebP (inside a RIFF container)
QkBMP
AAABAAICO (icon)
PHN2Zy or PD94bWwSVG (text beginning <svg or <?xml)
SUkq or TU0ATIFF

Features

  • Forgiving input. Spaces and line breaks are ignored. URL-safe Base64 (- and _), missing equals padding, percent-encoded text and JSON escapes such as \/ are all handled.
  • Format from the bytes. PNG, JPEG, GIF, WebP, BMP, ICO, AVIF and SVG preview in the browser. TIFF, HEIC and JPEG XL are recognized and can be saved, but most browsers cannot show them.
  • Cut-off warning. A PNG without its end chunk, a JPEG without its end marker or a GIF without its trailer triggers a warning that part of the string may be missing.
  • Plain-language errors. A bad character is named with its position, and incomplete or merged strings get their own message.
  • Several outputs. Original bytes untouched, a PNG or JPG copy (JPG at 95% quality, transparent areas white), or Copy Image to Clipboard, which needs a browser that allows image copying.
  • Batch ZIP. Several decoded images save as decoded-images.zip with files named decoded-image-1, decoded-image-2 and so on.
  • Open .txt and shortcuts. Load a .txt, .b64, .base64, .json, .html, .css or .svg file that contains Base64 or data URIs, and it decodes at once, or press Ctrl+Enter (โŒ˜+Enter) to decode what you pasted.
  • Non-images are not lost. If the data is not a picture, you still get a download of the decoded bytes, as .pdf or .bin.

How to Use the Base64 to Image Converter

  1. Copy the Base64 text from your API response, HTML or CSS source, database export or DevTools. Include the data: prefix or leave it out.
  2. Paste it into Base64 Input, or click Open .txt to load a file. A character count appears under the box.
  3. Click Decode Image, or press Ctrl+Enter (โŒ˜+Enter).
  4. Check the Preview and the Format, Dimensions and File Size lines. An amber note appears if the string looks cut off, and the Format line says when the data URI label does not match the bytes.
  5. Click the first button, for example Download as JPEG (original), for the exact file. Use Download as PNG, Download as JPG or Copy Image to Clipboard for the other options (the button for the format you already have is hidden).
  6. With several images, use Download all N as ZIP (original formats) (N is the number of images). Clear empties the box and the results.

Once the file is saved, finish it with other tools. Shrink it with the image compressor, resize it with the image resizer, or switch formats with the WebP to PNG converter, the PNG to JPG converter or the TIFF to PNG converter for the formats your browser cannot preview. If the Base64 sits inside a JSON response, the JSON formatter makes the right field easy to find.

Who Can Use It

  • Developers checking an image field in an API response, a log line or a database export.
  • Front-end designers pulling inline images out of CSS or HTML, and turning inline SVGs into files.
  • Testers and support teams opening a screenshot or upload that arrived as text.
  • Students learning how Base64 and data URIs work by decoding a small image and watching the format appear.

FAQs

How do I convert a Base64 string to an image?

Paste the Base64 text, with or without the data:image/...;base64, prefix, into the Base64 Input box and click Decode Image. The preview shows the picture with its format, dimensions and file size. Then click the download button for the original file, save a PNG or JPG copy, or copy the image to the clipboard.

Is it safe to decode Base64 images online? Are they uploaded?

Nothing you paste is uploaded: decoding, preview and download all happen in your browser, and you can confirm this in the Network tab of DevTools. Base64 itself is only an encoding, not encryption, so anyone holding the string can decode it. Treat a string containing a signature, ID scan or screenshot as the sensitive file it really is.

What is the difference between Base64 and a data URI?

Base64 is the encoding: the image bytes written as letters, digits, + and /. A data URI is a wrapper that adds a type label, in the form data:[type];base64,[the Base64]. Raw Base64 has no label, so the tool works out the format from the decoded bytes. It accepts both, plus quotes or a CSS url(...) around the string.

Why does my Base64 string fail to decode or show an error?

Common causes are a character that is not Base64 (the message names it and its position), an equals sign in the middle because two strings were pasted together, a string cut off while copying, or valid Base64 that is not an image, such as a PDF. Spaces, line breaks, URL-safe characters (- and _) and missing equals padding are accepted.

How can I tell what image format a Base64 string is?

The first characters give it away: iVBORw0KGgo is PNG, /9j/ is JPEG, R0lGOD is GIF, UklGR is usually WebP (a RIFF file) and PHN2Zy is SVG text. The tool reads the decoded file signature instead of trusting a label, so if a data URI says image/png but the bytes are a JPEG, it shows JPEG and notes the mismatch.

How do I save a Base64 image as PNG or JPG?

After decoding, use Download as PNG or Download as JPG. These redraw the image on a canvas; JPG is saved at 95% quality and turns transparent areas white, and an animated GIF keeps only its first frame. The first button, labeled with the detected format and (original), saves the decoded bytes untouched, which keeps GIF animation.

Can I decode several Base64 images at once from HTML or CSS?

Yes. Paste a block of HTML, CSS or JSON that contains several data:image/...;base64 URIs, or click Open .txt to load such a file. Every image is decoded and shown with its own buttons, and the Download all N as ZIP (original formats) button saves them together as decoded-images.zip.

Why is Base64 text bigger than the image, and how big will the file be?

Base64 writes every 3 bytes as 4 characters, so the text is about 33% longer than the file. To estimate the result, count only the Base64 characters (not the data: prefix or line breaks), multiply by 3, divide by 4, then subtract 1 byte for each equals sign at the end. A 1,000,000-character string decodes to roughly 750,000 bytes.