Base64 to Image: Decode and Download a Picture
Paste Base64, a data URL, an img tag or a CSS url() and see the picture. The real type is read from the bytes, with dimensions and a download. Nothing is uploaded.
Paste Base64 above and the picture appears here.
Need to encode text or any other file? Use the Base64 encoder and decoder, or change the format with the image converter.
About Base64 to Image
Base64 to Image turns Base64 text back into a picture you can see and save. Paste a bare Base64 string, a full data URL, an <img> tag that holds one, or a CSS rule with url(data:...), and the page shows the image, tells you its real type and its size in pixels, and offers a download with the right file extension. It all runs in your browser. The text you paste is never uploaded, nothing leaves your device, and there is no account.
It is the quickest way to answer "what is this picture?" when you find a long data:image/... string in page source, a stylesheet, an API response, a database row or an email.
How to turn Base64 into an image
Steps
- Paste the text into the box. You can paste just the Base64, the whole data URL, the whole
<img>tag or the whole CSS rule, and the page finds the data inside it. - The picture appears below with its type, its size in bytes and its dimensions in pixels.
- Press Download to save it. The file name ends in the real type, for example
image.pngorimage.jpg. - To go the other way, switch the direction to Image to Base64, or open the Image to Base64 converter.
What is accepted
Line breaks and spaces inside the text are ignored, missing = padding is fine, and the URL-safe alphabet with - and _ is read like the standard one. The supported pictures are PNG, JPEG, WebP, GIF, BMP and AVIF, up to 10 MB once decoded. SVG is not supported in this version.
How the real type is found
Every image format starts with a recognisable signature. A PNG begins with the bytes 89 50 4E 47, a JPEG with FF D8 FF, a GIF with the letters GIF, a BMP with BM, a WebP with RIFF and later WEBP, and an AVIF with ftyp and a brand such as avif. The page reads these bytes, not the label in the data URL. When the label says image/png and the bytes are a JPEG, the real type is used for the preview and the file extension, and a note tells you what the text claimed.
The maths of the size
Base64 stores three bytes as four characters, so a text of characters that ends without padding holds about
bytes. A string of 400 characters therefore decodes to 300 bytes, and a string of 13,981,014 characters decodes to about 10,485,760 bytes, which is the 10 MB limit. The page checks this estimate before it decodes, so a text that is too long is refused at once instead of freezing the tab.
Worked example
Take the text data:image/png;base64,iVBORw0KGgo=. The page finds the prefix, reads the declared type image/png and takes the payload iVBORw0KGgo=. The eight decoded bytes are 89 50 4E 47 0D 0A 1A 0A, the PNG signature, so the real type is PNG and it matches the label. If you change a single character to $, the page reports that $ is not a Base64 character and gives its position counted from the start of what you pasted.
When something goes wrong
- Invalid Base64: a message names the first bad character and its position, for example a quote or a comma left over from the markup around the data.
- Valid Base64 that is not an image: the page says "This is valid Base64 but it is not an image we can show." The text could be a PDF, a zip file, plain text or an SVG. Use the Base64 decoder to download any kind of file.
- Too large: images over 10 MB are refused with a clear message.
Privacy
Decoding happens in your browser. The pasted text and the picture are never sent to a server, so it is safe to use with private screenshots and internal assets. Nothing is stored once you close the tab.
Related tools
To encode a picture, use the Image to Base64 converter. To decode text or any file, use the Base64 decoder. To change the format of the picture you just saved, use the Image Converter.
Frequently asked questions
What can I paste to get the picture back?
A bare Base64 string, a full data URL, an img tag that holds a data URL, or a CSS rule with url(data:...). The page finds the data URL inside the text, so you can paste straight from the page source or a stylesheet. Line breaks, spaces, missing padding and the URL-safe alphabet are all accepted.
How does the page know the real type of the image?
It reads the first bytes, which carry a signature: PNG, JPEG, GIF, BMP, WebP and AVIF each start differently. When a data URL says image/png but the bytes are JPEG, the real type is used for the preview and the file extension, and a note tells you what the pasted text claimed.
What does the message about valid Base64 that is not an image mean?
The text decoded without a problem, but the bytes are not a PNG, JPEG, WebP, GIF, BMP or AVIF picture. It could be a PDF, a zip file, plain text or an SVG. Use the Base64 decoder to download any file, or check that you pasted the whole string and not just part of it.
What does the position in an error message refer to?
It counts characters from the start of what you pasted, beginning at 1, and points at the first character that Base64 cannot contain, such as a quote, a comma or a stray letter from the markup around it. Delete or fix that character and the picture appears.
Is there a size limit when decoding?
Yes, the decoded image may be up to 10 MB, the same as when encoding. Longer input is refused with a message instead of freezing the tab. Everything runs in your browser, so the pasted text and the picture are never uploaded.