Base64 to Image Decoder

Paste a data URI or a raw Base64 string and see what image is inside it. The decoder works out the format from the bytes and gives you a file to download — all in this tab.

Base64 to Image Decoder

Drop your images here

Or choose files from your device

JPG, PNG, WebP, AVIF, GIF, BMP, ICO or SVG in · up to 20 images · max 40 MB each

Every file is decoded and re-encoded in this tab. Nothing is uploaded.

    No image added yet.

    Three steps — nothing to install

    1. Paste the string

      A full data URI or the Base64 part alone both work. Whitespace and line breaks from a copied email or JSON file are ignored.

    2. Decode

      The bytes are checked against the signatures of JPG, PNG, WebP, GIF, BMP, AVIF, ICO and SVG, so the correct file type is used even when the data URI claims something else.

    3. Download

      A preview and the real dimensions appear with a download link for a properly named file — .png, .jpg or whatever the bytes actually are.

    What you can paste

    Both forms are accepted. A data URI — data:image/png;base64,iVBORw0KGgo… — carries its MIME type in the prefix. A bare Base64 string is the same payload without the prefix, which is what you often get from an API response, a database column or a .txt export.

    Line breaks, spaces and tabs are removed before decoding, so a string that wrapped across lines in an email still decodes. URL-safe Base64, which uses - and _ instead of + and /, is handled too, and missing padding at the end is added back.

    The bytes decide, not the label

    A data URI can lie. Strings pasted from old exports often say image/jpeg while the payload is a PNG, or omit the type entirely. This page ignores the label and reads the first bytes of the decoded data: FF D8 FF is JPEG, 89 50 4E 47 is PNG, RIFF…WEBP is WebP, and so on for GIF, BMP, AVIF, ICO and SVG.

    That means the download gets the right extension and a program will open it on the first try. It also means a string that decodes to something else — a PDF, a zip, plain text — is rejected with a clear message instead of being saved as a broken image.

    Why a string fails to decode

    Almost every failure is one of three things. The string was truncated when copied, so its length is no longer a multiple of four and the tail is missing. Characters were lost in a chat app or an HTML page that mangled + into a space. Or the “Base64” is actually something else, such as a URL-encoded image or a hex dump.

    The decoder reports which of these it hit rather than showing an empty result. If the string decodes but the bytes are not an image, the message says so — that is not a corrupt image but a different kind of file inside the text.

    What the download contains

    The file is written from the decoded bytes exactly as they were encoded: no re-compression, no resizing, no metadata stripping. If the original was a JPEG with GPS coordinates, the downloaded JPEG still has them — this is a decoder, not a sanitiser.

    Use the EXIF remover afterwards if the file is going somewhere public. To go the other way and produce Base64 text from an image, use the Image to Base64 converter.

    Frequently asked questions

    Do I need the data: prefix?No. Paste the full data URI or only the Base64 payload; both decode. The prefix is read for information but the format is confirmed from the bytes.
    Why does it say my Base64 is invalid?Usually because the string was truncated or some characters were altered when it was copied. The length must be a multiple of four, and +, / and = must survive the copy intact.
    Which image formats are recognised?JPG, PNG, WebP, GIF, BMP, AVIF, ICO and SVG. The type is detected from the decoded bytes, so a wrong MIME type in the data URI does not matter.
    Does the download keep the original quality?Yes. The bytes are decoded and saved unchanged — no re-encoding happens, so the file is exactly what was encoded.
    Is the metadata still in the image?Yes. This is a decoder, not a scrubber. Run the EXIF remover on the result if the file is going to be published.
    Is my string uploaded?No. Decoding happens in this tab. Nothing is sent to a server and nothing is logged.