Where Base64 images come from
- APIs and databases that return pictures as a Base64 string inside JSON.
- HTML and CSS that inline small images as
data:URIs. - Email source, where attachments are stored as Base64 between boundary lines.
- Canvas and screenshots, since
canvas.toDataURL()returns a Base64 data URI.
When the type in the data URI is wrong
A data URI says what it contains, for example data:image/png;base64,. That label is only a claim, and it is sometimes wrong, especially in hand-written or generated data. This tool ignores the label and checks the actual bytes: PNG files start with a fixed 8 byte signature, JPEG with FF D8 FF, GIF with GIF89a or GIF87a, and so on.
If the label and the bytes disagree, the page tells you, and the download uses the extension that matches the bytes.
If the picture does not appear
- The string was cut off. A truncated image often fails to load, or shows only the top part. Make sure you copied all of it.
- There are backslashes. Base64 copied from a JSON string may have
\/instead of/. Remove the backslashes. - It is not an image. The Base64 may be a PDF or a ZIP. The page names the type and points you to the Base64 decoder to save it.
- Your browser cannot draw the format. HEIC, for example, only opens in a few browsers. You can still download the file and open it in an app that supports it.