How to use the Base64 to Image tool
- Paste the encoded picture, with or without its data:image prefix, into the Base64 or Base64 data URL box.
- Select Decode file. Select Example instead if you want to see the tool work on a sample PNG.
- Read the Result line to learn the size and which format was detected.
- Check the picture in the preview area below the result.
- Select Download. The file is named decoded.png, decoded.jpg, decoded.gif, decoded.webp or decoded.avif to match the detected format.
How the Base64 to image decoder picks a format
The decoder reads the file header after decoding the Base64 payload. The following signatures and file brands identify each supported image format.
If none match, the tool stops with The Base64 does not contain a supported image format and offers no download.
- iVBORw0KGgo: PNG, from the signature 89 50 4E 47 0D 0A 1A 0A.
- /9j/: JPEG, from the start marker FF D8 FF.
- R0lGODlh or R0lGODdh: GIF, from the text GIF89a or GIF87a.
- UklGR with WEBP at bytes 8 to 11: WebP, a RIFF container.
- AVIF: the ftyp box identifies the avif or avis brand.
Worked example: a one pixel GIF
The 56 characters below are a complete GIF. They decode to 42 bytes: the GIF89a header, a 1 by 1 logical screen, a two color palette, a graphic control block that marks color 0 as transparent, and one pixel of image data. The tool reports image/gif and names the download decoded.gif.
Input: R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
Result: 42 bytes · image/gif
File: decoded.gifOther image formats
The following formats require another decoder.
- SVG is XML text with no binary signature. Decode it with Base64 to Text to get the markup.
- HEIC images use a different file brand from AVIF. This decoder supports AVIF.
- BMP, ICO and TIFF have their own headers, which this tool does not check.
- JPEG 2000 and JPEG XL are separate formats that do not start with the JPEG marker.
Using the decoded image and the original string
Decoding is the reverse of inlining. A data URL such as data:image/png;base64, followed by the data lets HTML or CSS carry a small picture without a second request, at the cost of about one third more bytes. When you need the picture as a file again, for an asset folder, a bug report or a design tool, this page writes the bytes back out.
The output is never re-encoded. Dimensions, compression level, animation frames and embedded metadata are those of the original. To assert one specific format, use Base64 to PNG or Base64 to JPG, which reject everything else.
Frequently asked questions
Are my images uploaded to convert them?
No. The picture is decoded and previewed inside your browser. Screenshots, signatures and scanned documents that you paste are not sent anywhere.
Which image formats can this tool decode?
PNG, JPEG, GIF, WebP and AVIF. The format is detected from the first bytes of the decoded data, and the download gets the matching extension and media type.
Do I need to remove the data:image/png;base64, prefix?
No. Paste the complete data URL. The tool strips everything through the base64, marker. It also works if you paste only the part after the comma.
Why is my Base64 SVG rejected?
SVG is text, so it has no magic number for the tool to detect. Base64 SVG usually starts with PHN2Z or PD94bW. Use Base64 to Text to recover the SVG source and save it with an .svg extension.
Will an animated GIF stay animated?
Yes. All frames are part of the byte stream, and the stream is saved as is. The preview plays the animation the way your browser normally displays a GIF.
Why does the preview show a broken image?
The signature matched but the rest of the data is incomplete or damaged, most often because the string was truncated. The Result line still shows how many bytes were decoded, which you can compare with the expected file size.