Free Base64 to Image Decoder

Free Base64 to image decoder: paste a string or data URI to preview the image and download it. The real format is detected from the file bytes.

  • No upload, 100% private
  • Instant, in your browser
  • 100% free, no signup
Loading tool…
Read the complete guideHow to Decode a Base64 String or Data URI Into an Image File →

About the Base64 to Image tool

Sometimes an image arrives as a wall of text: a data URI inside HTML or CSS, a Base64 field in a JSON API response, an email source, or a log file. This Base64 to Image decoder turns that text back into a real picture you can see and save. Paste a full data URI or just the raw Base64 characters and the preview appears instantly.

The tool does not trust labels. It inspects the first bytes of the decoded data, the so-called magic numbers, to work out the real format: PNG, JPEG, GIF, WebP, BMP, ICO, TIFF, AVIF, HEIC or SVG. That means the download always gets the correct file extension, even when the data URI claims the wrong MIME type or there is no prefix at all. If the declared type and the real type differ, you are told.

Messy input is handled for you. Line breaks and spaces from copied text are removed, URL-safe Base64 using - and _ is accepted, and missing padding is fixed. When the text is not valid Base64, is cut off, or decodes to something that is not an image, you get a clear message instead of a broken picture. Everything runs in your browser.

How to use Base64 to Image

  1. Paste your Base64 string or data URI into the text box, or click “Load sample” to see how it works.
  2. Check the preview and the detected format, MIME type, file size and dimensions.
  3. Change the file name if you like; the correct extension is added automatically.
  4. Click the “Download” button (for example “Download PNG”) to save the image.
  5. Click “Clear” to decode another string.

Features

Format detection from bytes

Magic-number checks identify PNG, JPEG, GIF, WebP, BMP, ICO, TIFF, AVIF, HEIC and SVG.

Accepts data URIs or raw Base64

Paste with or without the data:image/…;base64, prefix, including URL-safe Base64.

Tolerant of copy-paste mess

Whitespace, line breaks and missing = padding are cleaned up automatically.

Clear error messages

Invalid characters, truncated strings and non-image data are reported in plain language.

Private decoding

The string is decoded in your browser; nothing is sent to a server.

When to use it

  • Turn a Base64 image copied from a database record or config file back into a viewable file.
  • Recover an image embedded as a data URI in a web page’s HTML or CSS.
  • Check what a Base64 image field in an API response actually contains while debugging.
  • Save a signature, QR code or chart image that an app exported as Base64 text.
  • Extract an inline image from an email’s raw source.

Frequently asked questions

What if the data URI says the wrong image type?

The real format is read from the decoded bytes. If it differs from the declared type, you are told, and the download uses the correct extension.

How do I convert Base64 to an image?

Paste the Base64 text or data URI into the box. The image is decoded and previewed immediately, and you can download it with the correct extension.

Do I need the data:image prefix?

No. Raw Base64 works too, because the tool detects the image type from the decoded bytes rather than from the prefix.

Why does it say my Base64 is invalid?

The text contains characters that are not part of Base64, or it was cut off while copying. Make sure you copied the whole string, without surrounding quotes.

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

Most browsers cannot display HEIC or TIFF. The file is still decoded correctly and you can download it and open it in an app that supports the format.

Is the decoded image uploaded anywhere?

No. Decoding and preview happen entirely in your browser.

Related tools