Base64 to Image

Paste a Base64 string or data: URI to see the image and save it as a file. PNG, JPEG, GIF and WebP are recognised automatically.

0 bytes
0 chars

Everything runs in your browser. Your text and files are never uploaded.

How to turn Base64 into an image

  1. Paste the Base64 string or the whole data:image/...;base64, URI into the left box. A small sample PNG is already loaded so you can see how it works.
  2. Check the preview that appears under the tool. The status line tells you which format was found and how large the file is.
  3. Click Download to save it. The file gets the matching extension: .png, .jpg, .gif or .webp.

How the format is detected

Every common image format starts with a fixed byte signature. After decoding, the tool looks at the first bytes:

Starts with (hex) Base64 often starts with Format
89 50 4E 47 iVBORw0KGgo PNG
FF D8 FF /9j/ JPEG
47 49 46 38 R0lGOD GIF
52 49 46 46 … 57 45 42 50 UklGR WebP

So you can often tell what an encoded image is just by its first characters: iVBOR is almost always a PNG and /9j/ a JPEG.

Fixing a Base64 image that will not decode

To go the other way, use image to Base64. For Base64 that holds text, use the Base64 decoder.

When to switch back to a normal image file

A data URI is handy for a small image you want to keep inside one file, but it has real costs as the image grows. Base64 text is about 33% larger than the image it holds, so a 300 KB photo becomes roughly 400 KB of text. That text sits inside your HTML, CSS or JSON, so it must be downloaded before the rest of the document can be used, and it is downloaded again every time that document changes.

A separate image file avoids both problems. The browser can cache it on its own and reuse it across pages, and it can start loading it in parallel with everything else. With HTTP/2 and HTTP/3, many small image requests share one connection, so the old reason for inlining icons (saving round trips) matters much less than it used to.

A practical rule: keep data URIs for images under a few kilobytes, such as icons, tiny placeholders, or images in a single-file HTML report or an email signature. For anything larger, decode it here, download the file, and reference it with a normal URL. If you received a long Base64 string from an API, saving it as a file this way is also the quickest way to check what it actually contains.

Frequently asked questions

How do I convert Base64 to an image?

Paste the Base64 string or the full data: URI into the left box. The tool decodes it, shows a preview under the boxes, and Download saves the picture with the right extension.

Do I need the data:image prefix?

No. The image type is detected from the first bytes of the decoded data, so a bare Base64 string works. A data: URI also works; its prefix is removed for you.

Why does it say binary data but show no preview?

The bytes are not one of the image formats the tool recognises (PNG, JPEG, GIF, WebP), or the string is damaged. You can still download the file and open it in another program.

Is the image uploaded?

No. Decoding and the preview happen in your browser; the image never leaves your device.