Skip to content
Jellykit

Base64 to Image Decoder

Turn a Base64 string or data URI back into an image file: the format is detected from the bytes, previewed, and saved with the right extension.

  • Runs on your device
Loading tool

About Base64 to Image Decoder

Paste Base64 text or a whole data URI, copied from CSS, HTML, JSON or an API response, and get the picture back as a file. The format is recognised from the decoded bytes themselves, so a data URI that claims the wrong type is caught and you are told. You see the format, the pixel size and the file size, and you can save it with the extension it really needs.

Line breaks, spaces, the URL-safe alphabet and missing padding are all handled. Text that is not Base64, or Base64 that holds something other than an image, is refused with a plain explanation. SVG is previewed only as a picture, so any script inside it never runs.

How it works

  1. A data URI is taken apart into its declared type and its data; CSS url() wrappers and quotes are removed. Bare Base64 is used as it is.
  2. The Base64 is decoded in this page, accepting both the standard and the URL-safe alphabet, with or without padding, line breaks or spaces.
  3. The first bytes are matched against the signatures of PNG, JPEG, GIF, WebP, AVIF, BMP, ICO, SVG, TIFF, HEIC and JPEG XL, which decides the format, the extension and the size read from the header.
  4. The image is shown through an ordinary image element. If this browser cannot draw the format, the file can still be saved unchanged.

Questions

What if the data URI says one type but the image is another?

The bytes win. The page warns that the declared type and the real format disagree, and the file is saved with the extension of what it really is, so it opens correctly.

Is it safe to decode an SVG from an unknown source?

Here, yes: the SVG is shown only as a picture, where scripts and links do not run, and it is never placed into the page as markup. The saved file is unchanged, so open it only where you trust it.

Why does it say this is not an image?

The text decoded to bytes that match no image format, such as plain text, JSON or a PDF. If the bytes are text, the start of it is shown so you can see what it holds.

Why is there no preview for my TIFF or HEIC image?

Some browsers cannot draw those formats. The image is still decoded and checked, and you can save it to open in an app that reads it.

How much text can I paste?

Up to 16 MB of Base64, which is an image of about 12 MB. Everything is decoded in your browser; nothing is uploaded.

Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.