Loading Base64 to Image Converter...
How to Convert Base64 to a PNG Image
PNGs end up as Base64 text all the time: icons inlined into CSS, logos in HTML email, screenshots returned by test runners, images drawn on a canvas and exported with toDataURL(), avatars stored in a JSON field. Paste the string below to see the picture and get the real file back.
Paste the Base64 string
Paste the string into the input panel, or upload a .txt file that contains it. A data:image/png;base64, prefix, line breaks and URL-safe Base64 are all accepted.
iVBORw0KGgo, which is the fixed PNG signature written in Base64.data:image/png;base64, part; it is stripped before decoding. Leave out the surrounding url(...) or quotes.Check the preview
A moment after you paste, the string is decoded and the PNG appears in the preview. The Format line tells you what the header says the file really is. If a character is not valid Base64, the error names its line and column.
What is inside a PNG
An eight-byte signature, then a series of chunks: IHDR with the width, height and colour type, IDAT with the compressed pixels, and IEND to close the file. Optional chunks carry things like the transparency of a palette image, gamma or a text comment. The PNG specification describes every chunk, and Base64 itself is defined in RFC 4648.
Download the PNG
Click Download to save the decoded bytes as a .png file. On wider screens you can type your own file name before saving.
Frequently Asked Questions
How can I tell that a Base64 string is a PNG?
Every PNG file opens with the same eight bytes, and in Base64 those come out as iVBORw0KGgo at the very start of the string. If you see that, it is a PNG. You do not have to check by hand, though: the page reads the decoded header and shows the format it found above the preview.
Will the transparent parts survive?
Yes. The page does not redraw or re-save the image. The file you download is exactly the bytes that were encoded, so the alpha channel, colour depth and any text chunks inside the PNG come back unchanged. In the preview you will see the page background through the see-through pixels.
I copied a data:image/png;base64 URI out of CSS or an email. Can I paste it as is?
Yes. The data:image/png;base64, part is stripped before decoding, and line breaks are ignored, so a string copied from a stylesheet, an HTML img tag or the source of an email works. Just leave out the surrounding url(...) or quotes.
Does this work with the output of canvas.toDataURL() or a screenshot tool?
It does. canvas.toDataURL() gives a PNG data URI unless you ask for another type, and many screenshot and testing tools (Puppeteer, Playwright, Selenium) hand back screenshots as Base64 PNG text. Paste the string here to look at the picture and save it as a real .png file.
Is the image re-compressed or resized?
No. Base64 is only a text wrapper around the file, so decoding gives back the original file byte for byte. Nothing is resized, re-compressed or converted. The decoded file is about three quarters the length of the Base64 text, because Base64 uses four characters for every three bytes.
It says JPEG or GIF instead of PNG. What happened?
The page names the format the bytes really are and saves the download with the matching extension, so a JPEG is saved as .jpeg even on this page. Nothing is converted between formats. If the string is not an image at all, for example text or a PDF, you get a message saying so, and Base64 to File can save that kind of data.
Is my Base64 sent to your server?
No. Decoding happens in JavaScript inside your browser, and the preview and the download are built on your own machine. Nothing is uploaded and nothing is kept, so a reload starts with an empty editor.
Related pages: PNG to Base64 · Base64 to Image · Base64 to File
Related Tools
Image to Base64
Convert images to Base64 encoded strings for embedding in HTML, CSS, and APIs
Base64 to Image
Decode Base64 encoded strings to view and download images (PNG, JPG, GIF, SVG)
PNG to Base64
Convert PNG images to Base64 encoded strings for embedding
BMP to Base64
Convert BMP/Bitmap images to Base64 encoded strings
Base64 to BMP
Decode Base64 strings to BMP/Bitmap images
Base64 to WebP
Decode Base64 strings to WebP images with transparency