Base64 to Image
Free Base64 to image converter: paste Base64 or a data URI, detect PNG, JPG, GIF, WebP, SVG or ICO from the bytes, preview it and download the file.
How to use Base64 to Image
- 1Paste the Base64 string or a full data:image URI.
- 2Check the preview, detected format, dimensions and size.
- 3Download the image file.
What makes it better
- Detects PNG, JPEG, GIF, WebP, AVIF, BMP, ICO and SVG from the bytes
- Works with or without a data: URI prefix
- Preview with dimensions and file size
- Download with the correct extension
- SVG is previewed as an image only, never inserted into the page
About Base64 to Image
Base64 to Image decodes a pasted Base64 string, with or without a data: URI prefix, and checks the first bytes to work out which image format it holds. You get a preview, the pixel dimensions and size, and a download with the correct file extension. If the data is not an image, it says so rather than showing a broken picture.
Common uses
- See what picture is hiding in a Base64 field of an API response or database export.
- Recover an image from a data: URI copied out of HTML or CSS.
- Check that a Base64-encoded signature or photo was captured correctly before sending it on.
- Turn a Base64 test fixture back into a file you can open.
Example
Input
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==
Result
PNG image, 70 bytes
Good to know
- The format is read from the file's first bytes, not from the MIME type in the data URI, so a mislabelled data URI still opens correctly.
- Truncated or corrupted images may decode as Base64 yet fail to display. The tool then reports that the browser could not draw it.
- SVG files can contain scripts, so they are shown only through an image element, which does not run them. Download an SVG only if you trust its source.
Base64 to Image FAQ
How do I convert a Base64 string to an image?
Paste the string into the box. The tool decodes it, recognizes the format, shows a preview and enables the Download button, which saves the picture with the matching extension such as .png or .jpg.
Do I need to remove the data:image/png;base64, prefix?
No. Paste it as it is. A full data URI and a bare Base64 string both work, and line breaks or spaces inside the text are ignored.
Why does it say the data is not an image?
The Base64 decoded fine, but the bytes do not start like any supported image. It may be a PDF, a zip, text, or a string that was cut off or encoded twice. Try the Base64 Decode page to look at the contents.
Which formats are recognized?
PNG, JPEG, GIF, WebP, AVIF, BMP, ICO and SVG. Other formats, such as TIFF or HEIC, are reported as unsupported.
Why does the image preview show an error?
The format was recognized but the browser could not draw it, which usually means the data is damaged or incomplete. Check that the whole Base64 string was copied, including the end.