Base64 to Image Converter — Decode Base64 Strings to PNG, JPG, WebP & More

Paste a Base64 string or a full data:image/… URI and instantly see the decoded image with its detected format and dimensions. Download as a real file or copy the clean data URI. Everything decodes in your browser — nothing is uploaded.

Need to encode an image instead? Image to Base64 Converter →
Paste a Base64 string to begin

What is Base64 to image conversion?

Base64 is a way of representing binary data — like an image file — as a long string of plain ASCII characters. Going from Base64 back to an actual image means decoding that string into the original bytes of the file: a PNG, JPEG, WebP, GIF, BMP, or SVG. Once decoded, the bytes can be displayed as a normal image, saved to disk with the correct file extension, or copied as a clean data:image/…;base64,… data URI for use in HTML, CSS, or Markdown.

This converter accepts a Base64 string in any of the common forms — raw, wrapped as a data URI, or in the URL-safe variant — and decodes it entirely inside your browser. You see the resulting image immediately, along with the detected file format and dimensions, and you can download it as a real file with one click.

When you’d need to convert Base64 back to an image

The most common situations:

  • Inspecting a data URI from a website’s source. You spotted a Base64-encoded image inside a CSS file, an HTML attribute, or a JSON payload, and you want to see what it actually is.
  • Recovering an image from a log file or database dump. Many systems store inlined images as Base64 inside structured records — decoding lets you view them.
  • Verifying that a Base64 string in your code is correct. A live preview confirms the data is intact and renders the image you expected, not a corrupted file.
  • Reading a Base64 attachment from a MIME email or API response. Email and many REST APIs use Base64 for binary payloads.
  • Reverse-engineering a small icon a designer hardcoded as a data URI so you can save it back to a regular file.
  • Saving a generated image from a tool that only outputs Base64 — turning the text string back into a downloadable PNG or JPG.

How to convert Base64 to an image

  1. Paste your Base64 string into the input box at the top of this page. You can paste raw Base64, a full data:image/…;base64,… data URI, or the URL-safe variant that uses - and _ instead of + and /. Whitespace and line breaks are stripped automatically.
  2. Wait for the live preview. The converter decodes within ~200 ms of finishing your paste and shows the image with its detected format and dimensions.
  3. Download the file using the “Download as PNG/JPG/WebP/…” button. The extension matches the actual format of the bytes, not whatever the data URI prefix claimed.
  4. Or copy a clean data URI if you need the string back in canonical form — useful when the original data URI you pasted had the wrong MIME prefix or extra whitespace.

Everything happens in your browser. The Base64 string never leaves your device, and the decoded image bytes live only in the browser’s memory until you close the tab.

Image formats this converter decodes

Base64 to PNG

PNG is the most common format people encode as Base64 because it is lossless and supports transparency. The decoder identifies a PNG by its signature bytes (89 50 4E 47) and downloads the file with a .png extension. Animated PNG (APNG) is also handled correctly — if the browser supports APNG playback, the preview animates.

Base64 to JPG / JPEG

JPEG is identified by its FF D8 FF magic bytes regardless of what the data URI prefix says. The decoded file downloads as .jpg. JPEG progressive scans, all standard color spaces (RGB, CMYK, grayscale), and embedded EXIF metadata are preserved exactly — the converter passes the bytes through without re-encoding.

Base64 to WebP

WebP files start with RIFF…WEBP and are detected from those bytes. Both lossy and lossless WebP are supported, as are animated WebP files in browsers that play them back. The download arrives as .webp.

Base64 to GIF

GIFs are detected from the GIF8 signature and downloaded with a .gif extension. Animated GIFs animate in the preview the moment they are decoded — no re-encoding, no frame loss.

Base64 to BMP

BMP is identified by its BM magic bytes and saved with a .bmp extension. BMP is rarely the right format for images on the web, but the decoder supports it for completeness when working with legacy data.

Base64 to SVG

SVG is plain XML, so the converter detects it by attempting to decode the first 512 bytes as UTF-8 and looking for the <svg or <?xml markers. Detected SVGs render in the preview just like raster images and download as .svg. Because SVG is text, you can also open the downloaded file in any code editor to inspect or edit the markup.

Base64 to ICO

Favicon (.ico) files are detected and downloaded with the correct extension. Useful when reverse-engineering favicons embedded as data URIs in HTML <link rel="icon"> tags.

Why magic-byte detection matters

Many Base64 decoders trust the data URI prefix to determine the file format — if the prefix says data:image/png, they save the result as a PNG, even if the bytes are actually a JPEG that someone mislabeled. That produces silently broken files: an image viewer might still display them by sniffing internally, but anything that goes by the file extension breaks.

This converter trusts the bytes, not the label. The first few bytes of the decoded buffer are checked against known signatures (the same approach browsers and operating systems use), and the detected MIME — not the user-supplied prefix — drives the file extension, the download dialog, and the canonical “Copy Data URI” output. If you paste a JPEG with a data:image/png prefix, the tool will tell you the bytes are actually JPEG and save them as decoded.jpg.

Raw Base64 vs. full data URI: what should you paste?

Either works. The two forms are:

  • Raw Base64: a string of letters, digits, +, /, and = padding — for example iVBORw0KGgoAAAANSUhEUgAA…. The converter detects the format from the bytes, no prefix needed.
  • Full data URI: starts with data:image/…;base64, followed by the same string — for example data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA…. The prefix is stripped automatically before decoding.

If your input came from a CSS rule (background-image: url("data:…");), an HTML src attribute, or a JSON field with a wrapping prefix, you can paste the entire fragment — the converter cleans it up for you.

What about URL-safe Base64?

Some systems — JWTs, OAuth flows, certain APIs — use a URL-safe Base64 variant where + is replaced with -, / with _, and the trailing = padding is sometimes stripped. The converter detects this variant and translates it back to standard Base64 before decoding, with no extra step required from you.

Is it safe to decode sensitive Base64 strings here?

Yes. The decoding pipeline is the browser’s built-in atob function, plus a Blob and an in-memory object URL. Nothing is sent over the network, no analytics is fired on the input, and the page works offline once it has loaded. After you close the tab, the decoded bytes are gone from memory; nothing is cached on disk. Treat the page like any other local utility.

What if my paste is not actually an image?

If the magic-byte check does not match a known image format, the converter surfaces a friendly error and points you at the general-purpose Base64 Decoder, which handles arbitrary text and file inputs. The image-only focus of this page is intentional: the live preview is unambiguous, the download has the right extension, and you avoid the foot-gun of saving non-image bytes with an image extension.

If Base64 decoding is part of a longer workflow, these companion tools cover the adjacent jobs:

FAQ

Frequently Asked Questions

It takes a Base64-encoded string — either raw, or wrapped as a full data URI like data:image/png;base64,… — and decodes it back into the original image bytes inside your browser. You see an immediate preview, the detected file format, the image dimensions, the decoded byte size, and you can download the result as a real image file or copy a clean data URI. The decoder works for PNG, JPEG, WebP, GIF, BMP, and SVG inputs.

You can paste any of the following: a raw Base64 string with no prefix, a full data URI starting with "data:image/...;base64,", or a URL-safe Base64 variant that uses "-" and "_" instead of "+" and "/". Whitespace, line breaks, and missing padding are all handled silently — you do not need to clean the string before pasting. If your input is malformed in a way the tool cannot recover from, you will see a friendly error explaining what to check.

Because the tool trusts the bytes, not the label. The data URI prefix is just metadata that whoever generated the string typed in — it can be wrong. Decoders that trust the prefix produce silently broken output. This converter sniffs the magic bytes at the start of the decoded buffer (the same way browsers and operating systems detect file types) and reports the real format. If your data URI says "image/png" but the bytes are actually a JPEG, the tool will tell you it is a JPEG and download it with the .jpg extension.

No — this page is image-only by design. If the magic-byte sniff does not match a known image format, the tool surfaces an error and points you at the general-purpose Base64 Decoder, which handles arbitrary text and file inputs. The image-only focus is what makes this page fast and the live preview unambiguous.

No. The Base64 string is decoded entirely in your browser using the standard atob function and the Blob/URL APIs. Nothing is sent over the network, no analytics is fired on the input, and the page works offline once it has loaded. The download button uses an in-memory object URL pointing at the decoded bytes — no upload step, no temporary server file.

PNG, JPEG (.jpg / .jpeg), WebP, GIF (including animated), BMP, and SVG. Any format the browser can natively render as an image is supported, since the preview uses an <img> tag. Animated GIFs play back correctly inside the preview. SVG images can be inspected by viewing the source of the page after decoding, since SVG is plain text.

The most common causes are: stray characters that are not part of the Base64 alphabet (anything outside A-Z, a-z, 0-9, +, /, -, _, and =), the string being truncated mid-character, or copying additional surrounding text by accident. Try pasting again, and make sure you grab only the encoded portion. If the string came from a JSON file or a copy-paste that wrapped lines, the tool already strips whitespace automatically — the issue is usually a non-Base64 character in the middle of the data.