Cadmeo

Base64 to Image Converter

Paste either the raw base64 or a full data:image/... string.

The base64 to image converter decodes a base64 string back into a viewable image and offers it for download. It accepts either a bare payload or a complete data URL, and reports the decoded size, which is always about a quarter smaller than the base64 text, because base64 inflates data by roughly a third.

How it works

encoded length = ceil(bytes / 3) x 4

3 to 4
base64 encodes every three bytes as four characters, a 33 percent increase
= padding
one or two equals signs pad the final group when the byte count is not a multiple of three
  • A data URL carries its own MIME type, so data:image/png;base64,... renders as PNG regardless of what the tool assumes.
  • A bare payload has no type information, so PNG is assumed, browsers usually render the image correctly anyway by sniffing the file signature.
  • The payload is validated against the base64 alphabet before decoding, so a truncated paste is reported rather than silently rendering nothing.

Examples

A full data URL

Input

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...

Result

The image renders, with its true dimensions and decoded size shown

The MIME type comes from the data URL itself. iVBORw0KGgo is the base64 encoding of the PNG file signature, which is why PNG data URLs all start the same way.

Size inflation

Base64 length

4,000 characters

Result

About 3.0 KB decoded

Four characters carry three bytes, so 4,000 characters is roughly 3,000 bytes. This is why embedding images as data URLs makes a page larger, not smaller.

Frequently asked questions

Why is my base64 string longer than the original file?

Because base64 encodes three bytes as four characters, which adds about 33 percent. It exists to move binary data through text-only channels (email, JSON, CSS) not to compress anything. A data URL is always bigger than the file it represents.

What if my base64 has no data URL prefix?

It still works. The tool assumes PNG, and browsers generally identify the real format from the file signature in the first few bytes anyway. Adding the correct data:image/... prefix removes any ambiguity.

Why does it say the base64 is invalid when it looks fine?

Usually a truncated paste. Base64 payloads for images are long and terminals or chat clients often cut them. The other common cause is URL-safe base64, which uses - and _ instead of + and /, and needs converting back before it will decode.

Is my image uploaded when I decode it?

No. Decoding happens in your browser with atob, and the preview is a data URL rendered locally. The page makes no network requests.