Skip to main content
Preparing workspace

Base64 to Image

Paste Base64 or a data:image URL to see the picture and save it with the right extension. PNG, JPEG, GIF, WebP, SVG and more are detected from the bytes.

Still loading. If the tool doesn’t appear, reload this page.

About this tool

Base64 to Image

Decode a Base64 string or data URL back into an image, identify its real format from the file signature, and read its pixel dimensions.

To convert Base64 to an image, paste the string — raw, or a full data:image/png;base64,… URL — and the picture appears at once, ready to download with the right extension. The format is read from the file's own signature (PNG starts iVBORw0KGgo in Base64, JPEG /9j/), and its pixel size from the header.

How to use Base64 to Image

  1. 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.

  2. 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.

  3. 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.

Why use Base64 to Image

  • Format read from the bytes

    Ten formats recognised — PNG, JPEG, GIF, WebP, BMP, ICO, AVIF, HEIC, TIFF and SVG — so a mislabelled MIME type is caught.

  • Real pixel dimensions

    Width and height are parsed from the PNG IHDR chunk, the JPEG SOF marker or the GIF screen descriptor, not guessed.

  • Nothing leaves the browser

    Decoding happens locally with `atob`; the image is never uploaded to a server.

Common use cases

  • Check what a `data:image/png;base64,...` blob in an API response really contains before wiring it into the UI
  • Recover an inline logo out of an HTML email or a CSS background-image rule and save it as a proper file
  • Confirm the dimensions and byte size of an avatar a client uploaded as Base64, without opening an image editor

Frequently asked questions

How do I convert a Base64 string back to an image?

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.

Link to answer
How much bigger is a Base64 image than the original file?

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 such as icons, where saving a request outweighs the extra third.

Link to answer
Why does my Base64 fail to decode?

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.

Link to answer
Can this tool tell a PNG from a JPEG if the MIME type 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.

Link to answer
How do I save the decoded image as a file?

Press Download image. The file is named with the extension of the format detected from its bytes — .png, .jpg, .gif, .webp and so on — not the one the data URL claims, so a JPEG labelled image/png still saves as a working .jpg.

Link to answer

Embed this tool on your site

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>

Browse all embeddable widgets →