How to convert Base64 to an image
- 1 Paste the Base64 text or data URI into the box.
- 2 The preview and details appear straight away.
- 3 Press Download image to save it.
- 4 If you see an error, check that the whole string was copied.
Decoding embedded images
Copy the whole string, from data:image to the last character; a cut-off string will not decode. Once saved, convert or shrink it with the Image Converter. To encode an image, use Image to Base64.
- Long strings in code often wrap across lines; line breaks are removed automatically.
- If the preview is blank, the data may be incomplete.
- Check the format shown before renaming the file.
Features
Detects the format
Recognises PNG, JPG, GIF, WebP, BMP, SVG and ICO even without a data: prefix.
Accepts code
Paste an img tag or CSS url() and the image is found inside.
Instant preview
See the image, its type, size and dimensions.
When to use it
Debugging code
Check what an embedded image in HTML or CSS actually shows. Create Base64 with Image to Base64.
API responses
Save images returned as Base64 in JSON.
Email source
Extract images embedded in an email's HTML source.
Database exports
Recover images stored as Base64 text.
Related Image tasks
Frequently asked questions
What do I paste?
Either a full data URI such as data:image/png;base64,iVBOR…, or just the Base64 part. The tool works out the format from the first characters.
Why does it say it is not an image?
The text may be cut off, contain extra characters, or encode a file that is not an image, such as a PDF.
Which formats can I download?
The image is saved in its original format: PNG, JPG, GIF, WebP, BMP, SVG or ICO.
Can I convert the result to another format?
Yes. Download it, then use the Image Converter to change it to JPG, PNG or WebP.
Does it handle URL-safe Base64?
Yes. Characters - and _ used in URL-safe Base64 are converted automatically.
Is there a size limit?
Very long strings of several megabytes may be slow to paste, but there is no fixed limit.
How can I tell the image type from the text?
PNG data starts with iVBORw0KGgo, JPG with /9j/, GIF with R0lGOD and WebP with UklGR.
Where do Base64 images come from?
They are often found in HTML and CSS files, email templates, JSON responses from web services and some database exports.
Can I paste Base64 from a JSON file?
Yes. Copy the value without the surrounding quotes, or paste it with them; extra quotes at the ends are removed.
Is my pasted text stored anywhere?
No. The text is decoded in your browser and is cleared when you leave the page, so private images stay on your device.
Can I decode Base64 offline?
Yes. Once this page has loaded, decoding works without an internet connection, because it runs entirely in your browser.
How this tool works. These image tools run entirely in your browser using the Canvas API built into every modern browser, the open-source libheif decoder for iPhone HEIC photos and Tesseract, a widely used open-source OCR engine, for reading text. Each tool is tested with real phone photos, screenshots and scans before it goes live, and nothing you open is sent to a server.
Built and reviewed by Hamza Farooq, founder and lead developer
· Last updated
· How we check our tools
· Report a problem