How to Convert Base64 to an Image

Base64 can carry image bytes as text. To turn it back into a picture, identify the image type, remove any surrounding markup, decode the data, then preview and save the result.

Open the Base64 to Image tool

Quick answer

A complete image data URL looks like data:image/png;base64,.... The part after the comma is the encoded image. Plain Base64 can also work when you select the correct image type.

What Base64 image data contains

Base64 is an encoding, not an image format. It represents binary bytes with text characters so the data can be placed in JSON, CSS, HTML, email, or another text-only system. Decoding restores the original bytes; it does not improve or recompress the picture.

A data URL includes a media type before the encoded content. For example, image/png identifies PNG bytes. If you only have the encoded characters, you may need to know whether the source was PNG, JPG, WebP, GIF, or SVG.

How to convert Base64 to image

  1. Copy the Base64 without code fences, variable names, or surrounding quotes.
  2. Paste it into the input and select the correct MIME type if needed.
  3. Decode, inspect the image dimensions and preview, then download the result.

A correct preview confirms that the bytes and media type agree. Save the file with the extension shown by the result rather than simply renaming the encoded text.

Why decoding can fail

An invalid-character error usually means punctuation, a URL prefix, or surrounding source code was pasted into a raw Base64 field. A truncated-input error often means the end of the string was lost. Base64 padding can end in one or two equals signs, although some systems omit padding.

If a file downloads but will not open, the declared type may be wrong. Changing a filename from .png to .jpg does not change its bytes.

Privacy and practical uses

Base64 is readable encoding, not encryption. Avoid pasting confidential image data into logs, public issue trackers, or chat messages.

Decoding is useful when inspecting API output, extracting an embedded signature, checking a generated data URL, or recovering a small image stored in a text record.

Try it in your browser

The free ToolPixels Base64 to Image processes your file locally in the browser. Review the result and keep the original file for comparison.

Use Base64 to Image