ZumaTools

Base64 to Image

Paste a base64 string or a full data URI below — the decoded image appears instantly with its format, dimensions, and file size.

Need the opposite direction? Use the Image to Base64 tool to encode an image file into a base64 string.

Decoded on your device — nothing is sent anywhere.

How it works

  1. Paste your base64 string or complete data URI (data:image/png;base64,…) into the input box — the image preview appears automatically as you paste.
  2. Check the detected format, dimensions, and decoded file size shown next to the preview. If the format could not be detected, pick it manually from the Format menu.
  3. Click Download image to save the file with the correct extension for its format.

Frequently asked questions

How does the tool know which image format my base64 string contains?
If you paste a full data URI, the MIME type is read from the prefix. For a bare base64 string, the tool decodes it and inspects the first bytes of the binary data — the so-called magic bytes — which uniquely identify PNG, JPEG, GIF, WebP, BMP, ICO, AVIF, and SVG. When neither method succeeds you can select the format manually.
Why does my base64 string fail to convert to an image?
The most common causes are a truncated string (copied only partially), stray characters that are not valid base64, or a data URI prefix pasted twice. The tool strips whitespace and line breaks automatically and accepts URL-safe base64, so if it still reports an error, the string itself is incomplete or corrupted rather than just formatted oddly.
Is my image data uploaded to a server?
No. Decoding, format detection, preview, and download all happen locally in your browser using standard web APIs — the page makes no network requests with your data. That makes it safe to decode images from internal systems, private API responses, or documents you are not allowed to share.
Can I convert a base64 string back to PNG, JPG, WebP, or SVG specifically?
Yes. The download always uses the actual decoded bytes, so the file keeps its original format — a base64-encoded JPEG downloads as a .jpg, a PNG as a .png, and so on. The tool does not re-encode or recompress anything; it simply restores the exact binary file that was originally encoded.
What is base64 image encoding used for in the first place?
Base64 lets binary image data travel through text-only channels: inline images in CSS and HTML via data URIs, images embedded in JSON API responses, email attachments, and blobs stored in databases or config files. This tool is the reverse step — turning such a string back into a viewable, saveable image, which is useful when debugging any of those systems.

About this tool

This converter turns a base64-encoded string back into a real image. Paste either a bare base64 string or a complete data URI — the tool handles both, along with URL-safe base64 and strings broken across multiple lines. The decoded image renders immediately as a live preview, together with its detected format, pixel dimensions, and decoded file size, so you can confirm you have the right data before saving anything.

Everything runs client-side in your browser. The string is validated and decoded to raw bytes with standard web APIs, and the format is identified from the file’s magic bytes — the first few bytes that fingerprint PNG, JPEG, GIF, WebP, BMP, ICO, AVIF, and SVG files. Because no request ever leaves your machine, it is safe to decode images extracted from private API responses, internal databases, or confidential documents. Invalid input produces a clear error message that explains what is wrong instead of a broken preview.

Developers reach for this tool constantly: checking what image an API actually returned inside a JSON payload, extracting a logo embedded as a data URI in a CSS file or HTML email, recovering an image blob stored in a database column, or verifying that an upload pipeline encoded a file correctly. Designers and support teams use it to view images forwarded as raw base64 text in tickets or logs.

A few practical notes. Base64 inflates data by roughly 33%, so the decoded file is always smaller than the string you pasted — the size shown is the true file size. If detection fails but you know the source, the manual format selector will usually get the preview working, since browsers are tolerant of most raster formats. And if you need the opposite direction — turning an image file into a base64 string — the companion Image to Base64 tool linked below the converter does exactly that.

Related tools