Toolvore

Base64 to Image

Validate Base64 image bytes and dimensions, then preview and download the original file.

This tool runs entirely in your browser. Your data is never uploaded, never stored, and never leaves your device.

Validate complete Base64 and recover a still PNG, JPEG or WebP using its actual file signature and browser decode, with an exact-byte download.

How to use it

  1. 1Paste raw Base64 or a simple Base64 data URL without quotes or markup.
  2. 2Choose an alphabet if needed and explicitly allow omitted padding if applicable.
  3. 3Validate and inspect the format, dimensions and any MIME mismatch warning.
  4. 4Download the image with the extension matching its verified format.

Example

Input
Built-in PNG data URL
Output
1 × 1 PNG, 91 bytes, decoded-image.png

A false JPEG label is flagged; the actual PNG bytes and .png download are preserved.

What happens to your data

The pasted value and image are processed locally without uploading or persistent browser storage. Page assets and anonymous usage events may still make requests. Downloads retain original image bytes and metadata.

Last updated October 2026

Recover a PNG, JPEG or WebP from raw Base64 or a Base64 data URL. The tool validates the entire encoded value and checks the decoded image before displaying a preview or offering a download. It reports the verified format, dimensions and exact file size.

Use this when a JSON response, saved test fixture or inline page asset contains an image value that you need as a normal file. Copy only the Base64 value or data URL, without JSON quotes, an HTML element or CSS wrapper. The downloaded image retains the original decoded bytes.

How it works

Paste the value and select Validate and preview. Raw input can use standard Base64 or Base64URL, with automatic detection or an explicit alphabet. A data URL must use standard Base64 and a simple prefix such as data:image/png;base64,. Extra media parameters and percent-encoded data URLs are not supported. ASCII spaces, tabs and line breaks are ignored, including surrounding whitespace. Other characters are rejected across the complete input, not merely its opening characters.

Padding is required when needed unless Allow unpadded Base64 input is selected. The tool still rejects impossible lengths, mixed alphabets, extra or misplaced padding, and nonzero unused pad bits. This helps catch damaged copies instead of silently producing an image from a loosely accepted prefix.

After decoding, the image signature and header dimensions are inspected. The bytes must describe a supported still PNG, JPEG or WebP, then the browser must successfully decode them. The MIME type written in a data URL is only a label: when it disagrees with the actual image format, a warning explains the mismatch and the preview and download use the verified format. For example, PNG bytes declared as image/jpeg are downloaded as .png. Unknown content is never guessed to be PNG.

Decoded files are limited to 10 MiB, 12 million pixels and 8,192 pixels per side. Input length is bounded before decoding, allowing the maximum encoded size plus 4,096 characters for a prefix and whitespace. Both header and browser-decoded dimensions are checked. SVG, HTML, GIF, HEIC, animated PNG and animated WebP are unsupported. No untrusted HTML is inserted into the page; a supported raster is previewed through a local blob URL.

Download saves the original decoded bytes with the detected format's extension. It does not transcode, resize, strip metadata or sanitize the original image file. Browser-decoded orientation may reflect JPEG EXIF rotation. Editing the input or changing an option clears the prior preview and download so an old result cannot be mistaken for the new input. Clear or Cancel also invalidates an in-flight result.

Base64 parsing and image validation run in this browser without uploading the value or image. The page can still request assets and send anonymous usage events. Explicit downloads create files on your device, and any original embedded metadata remains in them. Save the recovered file before leaving; this tool does not keep a history or restore pasted images after reloading.

Worked example: recover the built-in PNG

Input
The built-in data:image/png;base64,… example
Result
A 1 × 1 PNG image, 91 bytes, downloaded as decoded-image.png

The complete example is loaded by the button. Replacing its MIME label with image/jpeg triggers a mismatch warning while retaining the PNG output format.

Common use cases

  • Saving an image from a Base64 field in an API response
  • Recovering a small inline data URL as a normal image file
  • Checking whether a copied image payload is complete and decodable
  • Finding a mismatch between an image's declared MIME type and its actual bytes

Frequently asked questions

How do I turn Base64 into an image file?+

Paste raw Base64 or a simple Base64 data URL, then select Validate and preview. After the verified format and image appear, choose Download PNG image, Download JPG image or Download WEBP image, depending on the actual bytes.

Can I paste a full data:image URL?+

Yes, if it uses a simple ;base64, prefix and standard Base64. Copy the value without surrounding quotes. Percent-encoded data URLs, extra media parameters, HTML tags and CSS url(...) wrappers are not accepted.

What if the MIME type says JPEG but the file is PNG?+

The image's signature and successful browser decode determine the output type. A mismatch warning is shown and PNG bytes download with a .png extension. Merely changing the data URL label cannot turn one image format into another.

Why does a valid Base64 string fail to preview?+

Base64 can represent any bytes, including text, a PDF or a damaged file. The decoded bytes must also be a complete supported image within the file and dimension limits. A valid encoding alone does not establish that its contents are an image.

Does the download match the encoded image exactly?+

Yes. Download saves the decoded bytes without drawing to a canvas or recompressing. The tool chooses the filename extension from the detected format and preserves source metadata. This is recovery of bytes, not image conversion or metadata cleaning.

Can this preview an SVG or HTML data URL?+

No. Only still PNG, JPEG and WebP are supported. SVG, HTML, GIF and animated image payloads are rejected, and untrusted markup is never inserted into the page.