How to convert Base64 to an image
- Paste the text into the box: a full data URL, bare Base64, a CSS url() or a whole img tag.
- The picture appears as soon as the text is recognized, together with its type, pixel size and file size.
- Press Download to save it with the correct extension, such as .png or .jpg.
Where Base64 images come from
Developers run into encoded pictures all the time: an avatar returned by an API as a long string, an icon baked into a stylesheet, a screenshot stored in a database column, a chart pasted into an HTML report, or an image inside a JSON log. The text is unreadable to people, but it holds the complete file. This decoder turns it back into something you can look at and save.
What you can paste
You don't have to clean the text up first. The decoder accepts:
- a data URL that starts with
data:image/png;base64, - plain Base64 with no header at all
- text copied from CSS, like
url("data:…") - a whole HTML tag, like
<img src="data:…"> - text broken over many lines, with spaces, or in the URL-safe variant that uses - and _
- URL-encoded SVG data URLs that aren't Base64 at all
How the file type is found
Every image format starts with a recognizable signature: PNG files begin with the letters PNG after one special byte, JPG files with FF D8 FF, GIF with "GIF8", and so on. The tool reads these first bytes to work out the real format, even when there is no data URL header or the header is wrong. It recognizes PNG, JPG, GIF, WebP, BMP, ICO, SVG, AVIF, HEIC and TIFF, and names the download accordingly.
If the decoded bytes are a PDF or some other non-image file, you'll get a clear message instead of a broken picture.
When decoding fails
- The text is cut off. Long strings are easy to truncate when copying from a terminal or log viewer. Copy it again, making sure you have the end, which often finishes with one or two = signs.
- Extra characters crept in. Quotes, commas or escape sequences such as \n from a JSON file are handled, but other stray text may not be.
- It isn't Base64. Hex strings, binary dumps or encrypted text look similar but use different rules.
A HEIC or TIFF image may decode correctly yet fail to show, because many browsers can't display those formats. You can still download it and convert it with HEIC to JPG or Image Converter.
Private decoding
The text you paste is decoded inside this page with your browser's own functions. It isn't sent anywhere, which is useful when the image comes from a private API response or a customer database. To create Base64 from a picture file, use Image to Base64.
More ways to use this tool
Frequently asked questions
Do I need to remove the data:image/png;base64, part?
No. You can paste the full data URL or just the characters after the comma. Both work.
How do I know what file type the image is?
The tool looks at the first bytes of the decoded data, which reveal the real format, and shows it next to the preview. The Download button uses the matching extension.
Why does it say my Base64 is invalid?
Usually the text is incomplete or contains characters that don't belong, such as part of the surrounding code. Copy the whole value again, from the first character to the last.
Is the pasted text sent to a server?
No. Decoding happens in your browser. Nothing you paste leaves your device.
Can I decode Base64 that isn't an image?
This page is made for images. If the data turns out to be a PDF or another file type, it tells you instead of showing a broken preview.