Developer tools

Base64 to Image

Base64 to Image Converter

Decode a Base64 string or data URI to an image you can preview and download.

About this tool

About Base64 to Image

Found a long data:image/png;base64 string in some HTML, CSS, a JSON API response or a database column and want to see what it is? Paste it here. The tool decodes the data, works out the real format from the file's first bytes instead of trusting the label, and shows the picture on a transparency grid with its pixel dimensions and file size. You can then download it as a normal .png, .jpg, .gif, .webp, .svg, .bmp, .ico or .avif file. It accepts a full data URI or just the Base64 part, with or without line breaks, padding or the URL-safe alphabet. If the data decodes to something that isn't an image, such as a PDF or ZIP, it says so, and malformed Base64 is reported with the position of the first bad character. SVG is shown through an image element, so any scripts inside it never run. Nothing is uploaded: the image is decoded and displayed by your browser.

Built and maintained by Abhi JainUpdated

How to Convert Base64 to an Image

  1. 1

    Paste the data

    Paste a data:image URI or bare Base64 into the Base64 or data URI box.

  2. 2

    Check the preview

    The image appears with its format, size and pixel dimensions.

  3. 3

    Download it

    Click the Download button to save it with the right file extension.

Base64 to Image: questions and answers

How do I view a Base64 image?

Paste the string into the box and the image appears straight away. You don't need the data:image prefix; the format is detected from the bytes.

What format will the downloaded image be?

The original format stored in the Base64: PNG stays PNG, JPEG stays JPEG and so on. Nothing is re-encoded, so quality is unchanged.

Why does it say this isn't an image?

The Base64 decodes to another kind of file, or to data that's incomplete. Use the Base64 Decoder to download any file type.

Is it safe to open SVG from Base64?

Here, yes. The SVG is displayed with an <img> element, which never runs scripts or loads external resources.

More Image to Base64 presets