Base64 to PNG Converter
Paste a Base64 string or a data URI and download it as a PNG image. Everything runs in your browser — nothing is uploaded.
How to convert Base64 to a PNG
Paste your data into the box above. You can give it a full data URI — a string of the form data:image/png;base64,iVBORw0KGgo… — or just the raw Base64 payload without the data: prefix. The tool decodes the bytes locally and figures out what kind of image it is by reading the file's magic numbers: the first few bytes that identify a PNG (or JPEG, GIF, WebP). A live preview appears immediately. When it looks right, click Download PNG to save the file as image.png.
Why isn't my PNG showing?
If the preview stays empty or you get an error, one of these is usually the cause:
- The string is truncated. A partial copy cuts off the end of the image, so the bytes don't form a complete, valid file.
- It's URL-safe Base64 without padding. That's handled automatically — the tool converts
-and_back to+and/and re-adds the missing=padding before decoding. - The data isn't actually a PNG. Base64 of a text file, a PDF, or some other blob will decode into bytes, but the browser can't render it as an image.
- A copy/paste added stray characters. Line breaks and spaces are stripped automatically, but quotes, HTML entities, or a stray prefix can corrupt the payload.
Tip: if you only have a snippet, make sure you copied the entire Base64 string — these can be tens of thousands of characters long for a real PNG.
Decoding a data URI
You don't need to strip anything by hand. Paste the whole data URI including the data:image/png;base64, prefix and the tool removes it automatically before decoding. Pasting just the raw Base64 payload works too — both paths produce the same downloadable PNG.
Is this private?
Yes. The decoding happens entirely client-side in JavaScript. The Base64 you paste is decoded into bytes in the browser and turned into an object URL locally — it is never sent to a server. You can confirm this by opening DevTools → Network: pasting and decoding fires no request.
Frequently asked questions
How do I convert Base64 to a PNG?
Paste a full data URI (data:image/png;base64,iVBORw0KGgo…) or just the raw Base64 payload into the box above. It decodes the bytes locally, auto-detects the image type from the file's magic numbers, shows a preview, and lets you download the result as a PNG.
Why isn't my PNG showing?
Usually the string is truncated, it isn't actually a PNG, or a copy/paste introduced stray characters. URL-safe Base64 without padding is handled automatically. If the bytes still don't form a recognizable image, the preview will fail to load.
Can I decode a data:image/png;base64 URI?
Yes. Paste the whole data URI including the data:image/png;base64, prefix and it's stripped automatically before decoding. Pasting just the raw Base64 payload works too.
How do I convert a PNG TO Base64?
Use the PNG to Base64 tool to go the other way — drop a PNG and get a data URI you can paste into HTML or CSS.
Need to encode a PNG?
The main base64.dev tool handles text, files, and URL-safe mode with auto-detect.
Open base64.dev →