Skip to content

Base64 to Image Converter

Paste Base64 text or a data:image URI to preview the picture and download it as a real file. The type is detected from the bytes, and nothing is uploaded.

See what’s inside a Base64 string

Developers meet Base64 images in API responses, database fields, HTML source and CSS files. This decoder shows the picture, tells you its real format and size, and saves it as a normal image file you can open, edit or attach.

How to convert Base64 to an image

  1. Paste the Base64. Paste a data URI (data:image/png;base64,…), plain Base64, or even a CSS url(…) or HTML src="…" containing one. Line breaks and missing padding are fine.
  2. Decode. Click Decode to image. The file type is detected from the decoded bytes, not just the label.
  3. Download. Check the preview and download the image with the right file extension.

Snippet examples

<img src="data:image/png;base64,iVBORw0KGgo…" alt="Logo" />

.icon { background-image: url("data:image/svg+xml;base64,PHN2Zy…"); }

{ "filename": "logo.png", "data": "iVBORw0KGgo…" }

Going the other way? Use Image to Base64. To shrink an image before encoding it, run it through the Image Compressor or convert it to WebP first — a smaller file means a much shorter string.

Related tools and guides

Base64 to Image FAQ

Do I need the data:image/...;base64, prefix?

No. Paste either the full data URI or just the Base64 part. URL-safe Base64 (with - and _) and Base64 split across lines are handled too.

Why does it say the type differs from the data URI?

Sometimes a data URI is labelled image/png but actually contains a JPEG, or the other way round. The tool trusts the bytes, so the downloaded file opens correctly.

Why does it say my Base64 is invalid?

The text contains characters that Base64 never uses, or it was cut off when copying. Copy the whole value again, including the end, and try once more.

Are my images uploaded?

No. Encoding and decoding happen with JavaScript in your browser. Nothing is sent to a server or stored.

Why is the Base64 bigger than the image?

Base64 writes every 3 bytes as 4 text characters, so the text is about 33% larger than the file. That's the price of putting binary data inside HTML, CSS, JSON or email.

When should I inline an image as Base64?

For small icons, logos in HTML emails, single-file HTML reports and API payloads that only accept text. For normal website images, a regular file is better because browsers can cache it and load it in parallel.