Skip to content
1001 Tools
sr
Image tools

Base64 to Image

Paste a Base64 string or a full data URI and get the image back. The preview appears instantly, and you can download it as a real file. It accepts a bare Base64 payload or a complete data:image/… URI, and everything is decoded locally so the string is never sent anywhere.

Paste a Base64 string above to preview and download the image.

How it works

The tool reads what you paste and normalises it into a data URI the browser can render directly. If you include the data:image/…;base64, prefix, the media type is read from it; if you paste only the raw Base64, it is treated as PNG, which is the most common case. The Base64 is validated first, so malformed or non-image input is flagged instead of showing a broken picture.

The download simply saves the decoded bytes to a file with the right extension for the detected type. Nothing is re-encoded, so the image is byte-identical to whatever the Base64 represented. If the type is guessed as PNG but the data was really a JPG, the picture still displays correctly — only the file extension follows the declared type.

Practical examples

Extracting an image from CSS

You find a background-image: url(data:image/png;base64,…) in a stylesheet and want the actual file. Paste the data URI here and download the PNG.

Turning an API response into a file

An API returned an image as a Base64 string in JSON. Paste the string, confirm it in the preview, and save it as a real image to inspect.

Checking what a data URI contains

A long data URI is buried in some code and you’re not sure what it is. Paste it to see the image and its detected type before using it.

Frequently asked questions

What can I paste in?

Either a full data URI that starts with data:image/…;base64, or just the Base64 characters on their own. Line breaks and spaces are ignored, so pasting wrapped strings is fine.

What happens if I paste only the Base64 without a prefix?

It is assumed to be PNG, since that is the most common case. The preview will still render most formats correctly; only the download’s file extension is based on that assumption.

Why does it say my string is invalid?

The input must be valid Base64 — the right character set and a length that is a multiple of four — and must decode to an image type. Truncated strings, text data URIs, or copied fragments with missing characters are rejected.

Does it change the image at all?

No. The bytes are decoded exactly as encoded, with no re-compression, so the downloaded file matches the original that was turned into Base64.

Which image types are supported?

Common web types including PNG, JPG, WebP, GIF, SVG, BMP, ICO and AVIF. The type comes from the data URI prefix when present.

How do I create a Base64 string in the first place?

Use the companion Image to Base64 tool: drop in an image and copy the data URI it produces.

Can it handle very long strings?

Yes. Large Base64 blocks decode fine; only extremely large ones may take a moment to render the preview on slower devices.

Is anything uploaded when I paste?

No. Decoding and previewing happen entirely in your browser. The Base64 string and the resulting image never leave your device.

Related tools