About this tool
Decode a Base64 string or data URL back into an image, identify its real format from the file signature, and read its pixel dimensions.
Base64 to Image decodes a Base64 string — raw, or wrapped in a `data:image/...;base64,` URL from RFC 2397 — back into the original picture and shows you what it actually is. It identifies the format from the file's own magic number (the 8-byte PNG signature, JPEG's FFD8FF start-of-image, GIF89a, the RIFF/WEBP pair) rather than trusting the MIME type in the string, then reads the pixel dimensions straight out of the header. It is for developers debugging an API payload, an email template, or a CSS data URI that will not render.
Open Base64 to Image on AltFTool — it loads instantly in your browser.
Paste your data into the 'Base64 image data' box — raw payload or a full data:image/png;base64,… URL. Line breaks, spaces and URL-safe - and _ characters are handled automatically, the box opens with a sample PNG already decoded, and the preview limit is 25 MB.
There is no convert button: the decode runs as you type. The Decoded image panel shows the pixel dimensions and a live preview, and the table beneath it lists Format, MIME type, Decoded size, Base64 characters, Encoding overhead, Aspect ratio, Megapixels and the Suggested file name — with a red note when the data URL's declared type disagrees with the real bytes.
Click Download image to save it under the suggested name (base64-image-64x64.png for the sample), Copy data URL or Copy summary to put either on the clipboard, and Reset to bring the sample PNG back.
Ten signatures checked — PNG, JPEG, GIF, WebP, BMP, ICO, AVIF, HEIC, TIFF and SVG — so a mislabelled MIME type is caught.
Width and height are parsed from the PNG IHDR chunk, the JPEG SOF marker or the GIF screen descriptor, not guessed.
Decoding happens locally with `atob`; the image is never uploaded to a server.
Paste the string here and the decoded picture appears immediately — no upload, no sign-in. Everything after the comma in `data:image/png;base64,iVBORw0KGgo...` is the payload; you can paste the whole data URL or just that payload, and the tool strips the prefix for you.
Exactly 33% bigger before padding: Base64 turns every 3 bytes into 4 characters, so 100 KB of image becomes about 133 KB of text, plus up to 2 padding characters and the ~22-character data-URL prefix. That is why inlining is worth it only for small assets — roughly under 4 KB is the usual rule of thumb for CSS.
Almost always one of three things: the `data:image/png;base64,` prefix was left in a field expecting raw payload, the string was truncated in transit, or it is URL-safe Base64 (RFC 4648 §5, using `-` and `_`) pasted into a decoder expecting the standard `+` and `/` alphabet. This tool handles all three, and reports the offending character when something else is wrong.
Yes. It compares the decoded bytes against each format's file signature — PNG always starts 89 50 4E 47 0D 0A 1A 0A, JPEG starts FF D8 FF, GIF starts with the ASCII text GIF87a or GIF89a — and flags a mismatch when the data URL's declared type disagrees with what the bytes say.
Add the Base64 to Image widget to your blog or website — free, responsive, no signup. Just keep the “Widget by AltFTool” credit link visible.
<iframe src="https://www.altftool.com/embed/widget/base64-to-image"
title="Base64 to Image — free AltFTool widget"
width="100%" height="640" style="border:0;border-radius:12px;overflow:hidden"
loading="lazy" referrerpolicy="no-referrer-when-downgrade" allow="clipboard-write"></iframe>
<p style="font-size:12px;margin:4px 0 0">Widget by <a href="https://www.altftool.com/tools/all/base64-to-image?utm_source=embed&utm_medium=widget" rel="nofollow">AltFTool — free online tools</a></p>