Home › Developer & Design › Base64 to Image
Base64 to Image Decoder
Paste encoded text to preview and download the picture inside it.
How to decode
- Paste a data URL or Base64 text.
- Press Decode.
- Check the preview and download the file.
Accepted input
A full data URL or only the encoded part both work. Spaces and line breaks are ignored. The tool recognises PNG, JPG, GIF, WebP, BMP and SVG by looking at the data itself, then gives the download a matching extension.
How to spot the type
| Text often starts with | Likely type |
|---|---|
| iVBORw0KGgo | PNG |
| /9j/ | JPG |
| R0lGOD | GIF |
| UklGR | RIFF file, such as WebP |
If decoding fails
- Copy the whole string, including its end.
- Remove quotation marks, brackets or code around it.
- Check for a URL-safe variant that uses - and _ ; this tool expects standard Base64.
- Confirm the data is an image and not a document or compressed text.
Where such strings appear
Developers find them in stylesheets, HTML pages, API responses and email source. Decoding lets you view what is inside.
A safety habit
Treat data from unknown sources with care, particularly SVG files, which can contain code. Do not open a downloaded file you do not trust, and do not paste secrets into any tool unnecessarily.
Reading the result
If a preview appears, the browser was able to open the data as an image. That does not prove where it came from or that the picture is genuine. Check the downloaded file size and dimensions if you expected a particular asset. When the text came from an application error log, share only the part needed to diagnose the problem.
Why you might need to decode
You may find a long string of text starting with "data:image/png;base64," in a web page, an API response or an email. Decoding it recovers the original picture so you can view it or save it as a file.
Troubleshooting
- Nothing shows: make sure you copied the whole string. A missing character at the start or end breaks decoding.
- Extra characters: remove spaces and line breaks added by email or text editors, and any quotes around the string.
- Wrong type: the prefix says what kind of file it is, for example image/png or image/jpeg. If the data is something else, such as a PDF, it will not display as an image.
A safety note
Only decode data from sources you trust. A picture can be harmless, but files received from unknown senders can be misleading. Do not enter passwords or private information on pages you opened through unknown links.
If you need to go the other way, use the Image to Base64 tool.
Frequently Asked Questions
Does the downloaded file match the original?
It contains exactly the decoded bytes.
Is my text sent to a server?
No. Decoding runs in your browser.
Do I need the data:image prefix?
Many decoders accept the raw Base64 as well as the full data URI. If it fails, try the complete string including the prefix.
Why do I get a broken image?
The string may be truncated, contain spaces or be a different type of data. Copy it again carefully.
Can I decode files that are not images?
This tool is for images. Other file types need a suitable decoder.