π’ Base64 to Image
Paste a data URI or raw base64, preview it, download as PNG or JPG.
Decode Base64 Into a Real Image File
Base64 shows up everywhere in modern development: APIs return images as base64 strings inside JSON, HTML emails embed images as data URIs, and CSS sometimes inlines small icons the same way. When you need to see what that wall of text actually looks like, or save it as a normal file, this tool does the job in seconds. Paste the string, click Decode, and you get a preview plus a one-click download as PNG or JPG. No signup, no upload, and no command line needed.
The tool accepts two input styles. A full data URI starts with something like data:image/png;base64, followed by the data; the tool reads the MIME type from that prefix. A raw base64 string with no prefix also works: the tool decodes the bytes and identifies the format from the file signature, those magic bytes at the start of every PNG, JPG, GIF, WebP, or BMP file. Either way you get the true dimensions, the decoded file size, and a preview before you download.
Where Base64 Images Come From
You will most often meet base64 images when working with APIs. Many image-generation and vision APIs return the picture as a base64 field in the JSON response rather than a URL. Copy that field value straight into this tool to see and save the result. Front-end developers meet data URIs in CSS, where tiny icons get inlined to avoid extra HTTP requests. Email developers use them in HTML email because many mail clients block external images but render embedded ones. Database dumps and log files sometimes contain base64 image blobs too.
One practical note: base64 inflates data by about 33 percent, so a 3 MB photo becomes a 4 MB string. That is why APIs usually only return small or medium images this way. If your paste is tens of megabytes, the tool will still try, but your browser tab may get sluggish during decoding.
Choosing PNG or JPG for Download
The preview shows the image exactly as decoded. For download, pick PNG when you need pixel-perfect quality, transparency, or plan to edit further: screenshots, logos, and graphics with text. Pick JPG for photos when file size matters, since JPG compression shrinks photographic images dramatically with little visible loss. The download keeps the original pixel dimensions in both cases; only the encoding changes.
Troubleshooting Bad Pastes
If the tool reports an invalid image, the string was usually damaged in copying. Check that you grabbed the entire value, especially the end, since editors often truncate long lines. Whitespace and line breaks inside the string are mostly harmless because the tool strips them, but characters like ellipses (...) or HTML-escaped entities (&) mean the copy came from a rendered view rather than the raw source. Go back to the raw API response or source file and copy again. And remember: everything runs locally in your browser, so even sensitive strings are safe to paste.
Frequently Asked Questions
How do I convert a base64 string to an image?
Paste your base64 string or full data URI (like data:image/png;base64,...) into the text box and click Decode. The tool detects the format automatically, shows you a preview, and tells you the dimensions and approximate file size. Pick PNG or JPG and click Download. Raw base64 without the data URI prefix works too, the tool sniffs the image type from its signature bytes.
What is a data URI?
A data URI embeds file content directly in text using the format data:[mime];base64,[data]. Developers use them to inline small images in HTML, CSS, and JSON APIs so no separate image request is needed. They are handy for tiny icons and for APIs that return images as JSON strings, but they make the text about 33 percent larger than the original binary.
The paste is huge. Will the tool handle it?
Yes, within reason. The tool processes the string in your browser, so multi-megabyte pastes work, though very large ones (tens of megabytes) may feel sluggish while decoding. If your editor struggles to even copy the string, consider asking the source for the original file instead. There is no server upload limit because nothing is uploaded.
Can I convert an image TO base64 instead?
This tool decodes base64 into an image. To go the other direction, upload any image to the Image Compressor or EXIF Remover tool and the workflow is similar, but a dedicated encoder is the cleaner path. Many code editors also have base64 encode commands built in.
Why does it say invalid image?
The usual causes: the string was truncated when copied (check the end was not cut off), it contains whitespace or line breaks in odd places (the tool strips most of these automatically), or it is not actually image data. The tool validates the decoded bytes against known image signatures (PNG, JPG, GIF, WebP, BMP) before showing a preview.
Is it safe to paste sensitive base64 here?
Yes. Decoding happens entirely in your browser with JavaScript, so nothing you paste is ever sent to a server or stored. That makes it safe to decode base64 strings containing API responses, tokens, or private images in data URLs. Your browser tab is the only place the data exists, and closing it wipes everything from memory. For debugging and one-off conversions, this tool keeps your data strictly on your own device.