MinifyPic

Base64 to Image Decoder

Paste a Base64 string or a full data URI and get the image back — previewed in place and ready to download, with the prefix handled for you.

FreeNo uploadData URI aware
Base64 encoder and decoder

Click to upload image

Supports JPG, PNG, WebP, GIF

Base64 Output
~33%
Size overhead Base64 adds to binary data
4:3
Base64 characters produced per 3 input bytes
100%
Decoding done inside your browser
0
Strings sent to a server

How it works

A compact workflow from input to download.

1

Switch to decode

Select the decode mode in the tool below. It accepts a raw Base64 string or a complete data URI.

2

Paste your string

Paste the value, with or without the data:image/png;base64, prefix — the tool detects and handles both forms.

3

Preview and download

The decoded image renders immediately so you can confirm it is correct, then save it as a real image file.

Tool details

Practical capabilities and safeguards built into this workflow.

Handles the data URI prefix

Strings copied from CSS, JSON, or a browser inspector usually carry a data:image/...;base64, prefix. Paste it as-is and it is stripped for you.

Preview before you save

The image renders in place, so you can confirm you pasted the right string rather than downloading a file to find out.

Nothing is transmitted

Base64 payloads from an API response or a log file often contain confidential data. Decoding runs locally, so nothing is sent anywhere.

Encodes as well as decodes

The same tool converts an image file into a Base64 string when you need to go the other direction.

Clear errors on bad input

Truncated or corrupted strings are reported rather than silently producing a broken file.

No signup or limits

No account, no character cap, and no watermark on the decoded image.

Frequently asked questions

How do I convert a Base64 string back to an image?
Switch the tool to decode mode, paste your Base64 string, and the image appears immediately. You can then download it as a normal PNG or JPG file. The data URI prefix is optional — the tool handles strings with or without it.
What is a data URI and do I need to remove the prefix?
A data URI embeds a file directly in text, in the form data:image/png;base64,iVBORw0KG... The part before the comma declares the type and encoding. You do not need to remove it — the tool detects the prefix and strips it automatically.
Why does my Base64 string fail to decode?
The usual causes are truncation from copying out of a narrow terminal or editor, stray line breaks or spaces introduced by wrapping, or the string being URL-safe Base64 (using - and _ instead of + and /). Re-copy the complete value and try again.
How can I tell what image format a Base64 string holds?
The data URI prefix states it directly. Without a prefix, the first characters give it away: iVBORw0KGgo indicates PNG, /9j/ indicates JPEG, R0lGOD indicates GIF, and UklGR indicates WebP. Decoding it here and previewing is the quickest check.
Does Base64 make files larger?
Yes, by roughly 33%. Base64 represents every three bytes of binary data as four ASCII characters, so a 90 KB image becomes about 120 KB of text. That overhead is the main reason to use Base64 only for small assets.
Is my Base64 string sent to a server?
No. Decoding happens entirely in your browser. This matters because Base64 blobs pulled from API responses or application logs frequently contain data you should not paste into a remote service.
When should I embed images as Base64 rather than link them?
Only for very small assets — icons, tiny sprites, single-pixel spacers — where saving an HTTP request outweighs the 33% size penalty. Anything larger should stay a separate file so it can be cached independently by the browser.

Understanding Base64 Encoded Images

Base64 is a way of representing binary data using only 64 printable ASCII characters. It exists because many systems — email bodies, JSON payloads, CSS files, XML documents — were designed to carry text and will corrupt raw binary bytes. Encoding an image as Base64 lets it travel safely through those channels as an ordinary string, at the cost of making it about a third larger.

How the encoding works, and why it grows by a third

Base64 takes three bytes of input, treats them as 24 bits, splits that into four groups of six bits, and maps each group to one of 64 characters. Three bytes in, four characters out — a 4:3 expansion, hence the roughly 33% overhead. Where the input length is not divisible by three, one or two = characters are appended as padding. This is also why a valid Base64 string's length is almost always a multiple of four.

Recognising formats from the first few characters

Because the encoding is deterministic, each image format produces a recognisable prefix. A string starting iVBORw0KGgo is a PNG, since that encodes the PNG magic number. One starting /9j/ is a JPEG. R0lGOD indicates GIF, and UklGR indicates a WebP RIFF container. This is a genuinely useful debugging shortcut when an API returns an untyped blob and you need to know what you are dealing with.

When embedding is worth the overhead

Inlining an image as a data URI removes one HTTP request, which used to be a meaningful win. Under HTTP/2 and HTTP/3, requests are multiplexed over a single connection and are far cheaper, so the calculation has shifted. Inlined images also cannot be cached separately — change one byte of your CSS and the browser re-downloads every image embedded in it. The practical guidance is to inline only assets of a few kilobytes, and keep everything else as a linked file.

Common failure modes when decoding

Most decode failures are transport problems rather than encoding problems. Copying from a terminal that hard-wraps lines injects newlines. Copying from a truncated log gives you a partial string. URL-safe Base64 substitutes - for + and _ for /, which a strict decoder rejects. And a string that decodes but renders as nothing is often not an image at all — it may be a PDF or an SVG. Previewing before downloading, as this tool does, catches all of these quickly. To go the other way, use the image to Base64 encoder.