Skip to tool

Base64 to image converter

Base64 to Image Converter

Paste Base64, preview the image, download it.

Paste Base64 or a data URI and the image appears straight away, with its real type, size and dimensions. Download it with the right file extension.

Free · No sign-up · PNG, JPEG, GIF, WebP, SVG, BMP

  • Real type detectionRead from the data, not the label
  • Size and dimensionsType, width × height and file size
  • Forgiving inputURL-safe, line breaks or no padding

Decode Base64 to an image

Paste a Base64 string or a data URI. The image appears as you paste.

Or drop a .txt or .json file here.

Raw Base64 and data URIs both work. Spaces, line breaks, URL-safe - _ and missing = are fixed automatically.

Options

On by default. Shows transparent areas.

Used only when the data has no known image signature.

Image

Your image shows here.

/base64-to-image

How it works

Paste, check and download in four steps.

  1. 1

    Paste or open

    Base64, a data URI, or a .txt or .json file.

  2. 2

    See the image

    It appears as you paste, with type and size.

  3. 3

    Check the type

    The real format is read from the data.

  4. 4

    Download

    Saved with the right extension.

Frequently Asked Questions

Quick answers on formats, odd Base64, and what the converter reads from your data.

How do I convert Base64 to an image?

Paste the Base64 string or data URI into the box. The image appears as you paste, with its type, dimensions and file size. Press Download image to save it with the right file extension.

Why does it say the label and the data don't match?

A data URI starts with a label that names the image type, such as PNG, and that label can be wrong. The converter reads the first bytes of the data, which show what the file really is. When the two disagree, the data wins, so a file labelled PNG that holds JPEG data is shown and saved as JPEG.

Why can't my Base64 be shown as an image?

Either the text isn't valid Base64, or it decodes to a file that isn't an image. Invalid characters are highlighted in the box with their positions. If the data is another file type, such as a PDF, you can still download it with its own extension, or as .bin if the type isn't known. If the data looks cut off, the image may be incomplete.

Does it work with URL-safe Base64 or line breaks?

Yes. Spaces, line breaks and surrounding quotes are removed, URL-safe - and _ are converted back to + and /, and missing = padding is added. A note under the image says what was fixed.

Can I open a .txt or .json file with Base64 in it?

Yes. Press Open .txt or .json, or drop the file on the box. The converter finds the first data URI or Base64 image in the file and shows it, with the file name above the box.

Which image formats are supported?

PNG, JPEG, GIF, WebP, BMP and SVG, detected from the data itself. SVG is shown as a plain image, so any scripts inside it don't run. Other file types can still be downloaded with their own extension.

Do I need the data URI prefix?

No. Raw Base64 works too. Without a prefix, the type is read from the data. If the data has no known image signature, pick a format under Format if it can't be detected.