Base64 to PNG Converter

Paste a Base64-encoded image string (with or without the data:image/…;base64, prefix) and decode it back into a downloadable image. Works for PNG, JPG, WebP and GIF. Runs in your browser.

100% private — processed in your browser. No upload, no server.

What this tool does

This decoder reverses a Base64-encoded image string back into a real image file you can download. It accepts two input shapes: a complete data: URI like data:image/png;base64,iVBORw0KGgo… (which already tells the browser what format the image is) and raw Base64 with no prefix (in which case the tool auto-detects the format by inspecting the first few decoded bytes — the file signature, also called a "magic number").

The output is a real Blob — same as if you'd opened a downloaded file. You can preview it, save it to disk, or right-click to copy it into other apps.

Where Base64 image strings come from

How the decoder works

If your input includes the data: prefix, the tool reads the MIME type directly from it and trusts that label. If you paste raw Base64, the tool decodes the first 16 bytes and checks for known file signatures:

Whichever format is detected, the tool builds a Blob with the correct MIME type and offers it for download.

Tips and troubleshooting

Common mistakes that break the input

How big will the decoded file be?

Base64 always inflates the data by about 33%. So a 4,000-character Base64 string decodes to roughly 3,000 bytes (3 KB). The exact formula: decoded_bytes ≈ encoded_chars × 3 / 4, minus a small amount for padding. A 100 KB image needs about 135 KB of Base64 to represent it.

FAQs

Do I need to keep the data: prefix when pasting?

No — the tool handles both. If the prefix is present it's used to set the MIME type; if not, the tool inspects the decoded bytes.

Will this work for non-image Base64?

It's designed for images. If you paste Base64 of, say, a PDF, the tool may not detect it correctly. Use a generic Base64 decoder for that.

Can I decode multiple strings at once?

Not yet — one at a time.

Is anything uploaded?

No. The decode runs in your browser using the atob and Blob APIs.

Is there a size limit?

Practical limit ~50 MB of Base64 text. Browsers slow down with very large strings.

Does this support Base64URL?

Yes — the tool replaces -_ with +/ before decoding.

Related tools