Decode Base64 to an Image File
Turn Base64 text from an API response, database field or HTML source back into a real image. The file type is identified from the decoded bytes, so the download always gets the right extension.
How to decode a Base64 image
- Paste the Base64 string or the full data:image/…;base64,… URI into the box.
- Check the preview, detected type, dimensions and size.
- Click Download to save the image with the correct file extension.
Supported formats
- Input
- Base64 text, Data URI
- Output
- PNG, JPG, GIF, WebP, SVG, ICO, AVIF, BMP
Common reasons decoding fails
Base64 copied from JSON often contains escaped characters such as \n or \/ — remove the escapes first. A string whose length leaves one leftover character has been cut off. If the data decodes but isn't recognised as an image, it may be a PDF, a ZIP or plain text; the Base64 Decoder shows such content. The reverse direction — turning an image file into Base64 — is handled by Image to Base64.
Benefits
- Detects the real format from the file signature and flags data URIs with a wrong MIME type.
- Accepts line-wrapped, URL-safe and unpadded Base64.
- SVG content is previewed safely as an image, so embedded scripts never run.
Limitations
- HEIC and TIFF images can be decoded and downloaded but most browsers cannot preview them.
- Inputs larger than about 70 MB of text are rejected to keep the tab responsive.
Privacy and security
Decoding happens with JavaScript in this tab. The text you paste and the resulting image are never sent to a server or saved.
Read our privacy policy for details about the site as a whole.
Frequently asked questions
Do I need the data:image/… prefix?
No. You can paste either the bare Base64 characters or a complete data URI. The type is worked out from the decoded bytes either way.
Why does it say my data is not an image?
The first bytes of the decoded data didn't match any image format. It might be another file type (the message names it) or text that was Base64-encoded twice.
Is it safe to decode SVG from an unknown source?
Here, yes: the SVG is shown only through an <img> element, where browsers never execute scripts or load external resources. Be careful when opening the downloaded SVG directly in a browser tab, though.