BrowserTools

Base64 to Image

Decode data URIs back into image files

By Guga — BrowserTools maintainer, Tbilisi, Georgia Updated 2026-08-23
Free Private No uploads
What is Base64 to Image?

Data URIs show up in CSS, in email source, in JSON fixtures, and in bug reports, and when you need the actual file back you need a decoder. Paste the string here and the image renders immediately, before you download anything. A full data URI is used as-is, so the declared MIME type is preserved. Raw base64 with no data: prefix also works — the string is assumed to be a PNG in that case, since there is no header to tell us otherwise. Whitespace is stripped, and both the standard alphabet and the URL-safe variant with dashes and underscores are accepted, as is any line wrapping. The validator checks the character set and that the length is a multiple of four, which is what catches the truncated paste that otherwise decodes into a broken image.

Paste a Base64 data URI and instantly preview and download the decoded image as PNG, JPG or WebP. The local decoder also handles raw Base64 without the data: prefix.

Private Base64 to Image In Your Browser

Base64 to Image is processed locally with client-side JavaScript. Your files never touch a server, and there is no queue to wait in.

Step-by-Step

How to use Base64 to Image

1

Paste your string into the Base64 string or data URI field, with or without the data:image/… prefix.

2

The image renders as soon as the string is valid; a message appears if the preview cannot draw, which usually means truncation.

3

Check the result visually before saving — a partial decode often still produces a picture, just the wrong one.

4

Press Download as image file, and the extension is chosen from the detected MIME type.

Key Capabilities
  • Accepts a complete data URI or raw Base64 with no prefix
  • Tolerates whitespace and line wrapping, plus the URL-safe alphabet with - and _
  • Validates the character set and that the length is a multiple of four, catching truncated pastes
  • Picks the download extension from the decoded MIME type — PNG, JPG, WebP, or GIF
Common Use Cases
  • A developer extracting an inline image from an email's HTML source to inspect it properly.
  • A QA engineer reproducing a bug from a data URI pasted into a ticket.
  • A designer saving an icon out of a stylesheet so they can hand it to someone as a normal file.
Clear Answers

Frequently Asked Questions

It says my string is not valid Base64 even though it looks right. Why?
Two things trip this up. The length must be a multiple of four, so an unpadded string will fail; and any character outside the base64 alphabet will fail, which includes stray punctuation copied in with the data. Whitespace is fine — it is stripped before the check.
How do I know whether my decoded file is PNG or JPG?
If you pasted a full data URI, the MIME type is in the prefix and the download uses it. If you pasted raw base64 with no prefix, there is no header to read, so the tool assumes PNG and names the download accordingly.
The preview shows a broken image icon. What went wrong?
Most likely a truncated paste — part of the string was cut off in transit. The length check catches some cases, but a decode that fails partway can still be syntactically valid, so compare what you have against the original source.
Does pasting my string send it anywhere?
No. Decoding happens in the tab. The download step reads the data URI you just created, not a remote resource.

Related Guides

View all guides →