Base64 to Image Converter
Paste a Base64 string and see the image it holds, or pick an image file and get its Base64 text back. The tool spots PNG, JPEG, GIF, WebP and SVG from the data itself.
Base64 to Image Converter
Paste a Base64 string or data URI to see the picture inside it, or drop an image to get its Base64. Detects the real format, checks for errors and converts to PNG, JPG or WebP.
Convert to another format
JPG has no transparency, so transparent areas turn white. Conversion happens on a canvas inside your browser.
Drop an image here, paste one (Ctrl+V), or
PNG, JPG, GIF, WebP, SVG, BMP, ICO or AVIF up to 5 MB.
Saved on this device 0
Base64 makes data about 33% bigger, so inline images are best kept for small icons and placeholders. Everything here runs on your device.
Found a Bug or Missing a Feature?
Report any problems or suggest new features you want. You can write in English, Urdu, Hindi, or any language! Our AI will analyze your feedback and upgrade the tool.
About This Tool
Paste a Base64 string and see the image it holds, or pick an image file and get its Base64 text back. The tool spots PNG, JPEG, GIF, WebP and SVG from the data itself.
Somewhere in an API response, a database column or an email source there is a very long string that is secretly a picture. This base64 to image converter turns that string back into something you can look at: paste it above, and the image appears with its real format, size and dimensions. You can then download the original file or save a copy as PNG, JPG or WebP. Going the other way is just as easy, because the second tab turns any image into Base64, a data URI, a CSS rule or an HTML tag.
Reading the first characters of the string
Base64 looks like noise, but the first few characters give the file type away, because every image format starts with a fixed signature and Base64 encodes it the same way each time. A string beginning with iVBORw0KGgo is a PNG. /9j/ means JPEG. R0lGOD is a GIF, UklGR is the RIFF container used by WebP, PHN2Z is the start of an SVG, and JVBERi0 is a PDF pretending to be an image. The tool does this check on the actual bytes instead of trusting the label, which matters when a data URI claims image/jpeg and the file is a PNG.
Why a string refuses to decode
When the picture does not appear, the cause is nearly always one of a short list, and the error message above names which one.
- Line breaks and spaces. Email and older systems wrap Base64 every 76 characters. Whitespace is simply ignored here.
- The URL-safe alphabet. Some APIs replace + and / with - and _. The tool converts them back for you.
- Missing padding. The trailing = signs are sometimes stripped. They are added again automatically.
- A cut-off copy. If the length leaves one stray character at the end, part of the string is missing. This is the one problem no tool can repair, so copy the full value again.
- JSON escaping. Strings pulled out of JSON can contain \/ instead of /. Run the response through a JSON formatter first and copy the clean value.
- Extra wrapping. You can paste a whole CSS
url(...)or animgtag. The converter pulls the data out for you.
For an invalid character the message gives its position, so you can find a stray quote or comma quickly.
The 33 percent tax on every inline image
Base64 writes every three bytes of the file as four text characters, so the text is always about a third larger than the picture. A 30 KB logo becomes roughly 40 KB of text sitting inside your HTML or CSS. The results panel shows the exact overhead for each image.
That cost is why inline images make sense for tiny things: a 2 KB icon, a blurred placeholder, an image inside an email template where external files may be blocked. For anything bigger, a normal file is usually better, because the browser can cache it separately and the page can render before it arrives. The tool warns you once the output passes about 100 KB. Before embedding a large picture, shrink it with the bulk image resizer or switch to a lighter format with the image format converter.
Converting, and what gets lost
The conversion buttons redraw the decoded picture on a canvas and save it in the format you pick. PNG is lossless, so nothing changes. JPG and WebP use the quality slider, and lower numbers give smaller files with visible softness. JPG cannot store transparency, so transparent areas are filled with white, and that is the one surprise worth knowing about. An SVG is rasterised at its declared size, or 512 pixels wide if it does not declare one.
Three situations where this saves time
A screenshot stored in a database
Support tools often save attachments as Base64 text. Paste the field, check that it decodes, and download the original instead of asking an engineer to write a script.
A suspicious image in an HTML email
Want to see what a tracking pixel or banner really contains? Paste the data URI and look at its dimensions and type. A 1 × 1 pixel GIF tells its own story.
Embedding a logo in a single-file page
Drop the logo on the second tab, choose “HTML img tag” and paste the result into your page. The tab also gives you a CSS background-image rule and a Markdown image.
A note on safety and privacy
Base64 is an encoding, not encryption. Anyone can decode it, so never treat it as a way to hide anything. SVG files can contain scripts, which is why this page displays them through an image element, where scripts do not run, and never inserts them into the page as markup. Your data is processed locally. Nothing is uploaded, and the history list stores only strings small enough to keep comfortably, never the files you choose.
Frequently asked questions
How do I convert Base64 to an image?
Paste the string or data URI into the box above and press Show image. The picture appears with its format and size, and you can download it or save it as PNG, JPG or WebP.
Do I need the data:image/png;base64 prefix?
No. The converter accepts raw Base64 or a full data URI, and it detects the real format from the bytes either way.
Why does it say the Base64 is valid but not a recognised image?
The text decoded correctly, but the bytes do not match any image signature. It could be a PDF, a zip, encrypted data or another file type. If the string came from an API, check which field you copied.
Is there a size limit?
Pasted text up to about 14 million characters is accepted, and image files up to 5 MB can be encoded. Very large strings make any browser slow, not just this one.
Is my image uploaded anywhere?
No. Decoding, previewing and converting all happen inside your browser, so the picture never leaves your device.
