Base64 to image

Convert Base64 to an Image

Paste a Base64 string or a full data: URI, preview the image, and download it as a file — free and right in your browser.

Paste & previewAuto-detects formatNo sign-up PNG · JPG · WebP · GIF · SVG

Turning Base64 back into a file

Base64 strings show up everywhere — in CSS, in API responses, in saved data URIs, in config files. When you have one and need the actual image, this decoder converts it back: paste the string (with or without the data: prefix), and it rebuilds the original file so you can preview and save it.

The decoder is forgiving. It strips a data: URI prefix, removes line breaks and stray whitespace, handles URL-safe Base64, and repairs missing padding automatically. It then checks the decoded bytes really are an image, so a wrong or corrupt paste fails with a clear message instead of saving a broken file.

How to convert Base64 to an image

  1. Paste your Base64. Drop the raw Base64 body or a full data:image/…;base64,… URI into the box on the Decode tab.
  2. Decode. Click Decode — the image appears instantly in a preview, with its detected type and size.
  3. Download. Save the decoded image to your device; the file gets the correct extension automatically.

With or without the prefix

You can paste a full data:image/png;base64,… URI or just the part after the comma — the tool handles both. It even detects the real format from the bytes, so the download is correct even if the prefix was missing or wrong.

Base64 to image: how it works

Decoding reverses Base64: it reads the 4-character groups back into the original 3-byte sequences, reconstructing the exact bytes of the source file so you get a byte-for-byte identical image to download.

Data URI shape
data:image/png;base64,iVBORw0KGgo… (or just the part after the comma)
Size impact
Decoding shrinks the data back to its true binary size — the saved file is about 25% smaller than the Base64 text you pasted, because 4 text characters collapse back into 3 bytes.

When inlining as Base64 makes sense

  • You found a data: URI in a stylesheet, an API response, or a saved config and need the actual image file back.
  • Someone sent you a Base64 blob (e.g. in JSON or a chat) and you want to preview and save it as a real PNG, JPG, or GIF.
  • You're debugging and need to confirm a Base64 string really is a valid image rather than truncated or corrupt data.

When a normal file or URL is better

  • You already have the original file — re-decoding gains nothing.
  • The string is partial or truncated: missing characters make the bytes invalid, so it cannot be decoded into a usable image.

Practical tip

Pasting works with or without the data:image/…;base64, prefix; the decoder also tolerates line breaks, surrounding quotes, a url("…") wrapper, URL-safe -/_ characters, and missing = padding, and it sniffs the real format from the bytes so the download gets the correct extension even if the prefix was wrong.

More Base64 & data URI tools

Frequently asked questions

What can I paste?

Either a complete data: URI (data:image/png;base64,…) or just the raw Base64 body. Line breaks, quotes, and url() wrappers are stripped automatically.

Why does it say the data isn't an image?

The string decoded successfully but the bytes aren't a recognised image format — usually a copy/paste that lost characters, or Base64 of something that isn't an image. Re-copy the full string and try again.

What format will the downloaded file be?

The decoder sniffs the real format from the data (PNG, JPG, GIF, WebP, BMP, SVG, AVIF, or ICO) and gives the download the matching extension.

Where is my image processed?

The encoding and decoding happen in your browser, so the result is created on your own device. How any data associated with the tool is handled is described in our privacy policy.

More image tools