convert2image

Convert Base64 to an image

Paste Base64 text or a data URI and get the image back as a file you can view and download.

Paste Base64 to decode

Loading the tool…

Runs on your device. Your images are not uploaded anywhere.

How to use it

  1. Paste the Base64 text into the box. The data:image/… prefix is optional.
  2. The image appears with its format, size and dimensions.
  3. Download it.

Where Base64 images turn up

Developers meet them in API responses, JSON exports, database fields, HTML email source, CSS files and browser developer tools. They also appear in saved web pages and in some log files. The decoder accepts the string with or without the data URI prefix, ignores line breaks and spaces, and also accepts the URL-safe variant that uses - and _.

How the format is detected

The prefix can be wrong or missing, so the decoder checks the first bytes of the decoded data instead, the same “magic numbers” that operating systems use. A PNG always starts with the bytes 89 50 4E 47, a JPG with FF D8, a GIF with the letters GIF8, and so on. The downloaded file gets the correct extension even if the prefix claimed otherwise.

If it will not decode

The most common cause is a truncated string: something cut it off when copying. Check that you have the whole thing, often thousands of characters long. Quotation marks or a trailing ) copied from CSS will also break it.

Questions people ask

Do I need to include the data:image prefix?

No. Plain Base64 works. The format is detected from the data itself.

Why does it say the data is not an image?

The text decoded, but the result does not start like any known image format. It may be a different kind of file, or the string may be incomplete.

Is my data sent anywhere?

No. Decoding happens in your browser.