Base64 to Image Converter

Someone handed you a wall of Base64 text that used to be a picture? Paste it here and get the picture back — checked, identified and ready to download.

What this Base64 to image converter does

It reverses Base64 encoding. Paste in a Base64 string — either the full data URL form (data:image/png;base64,…) or the bare encoded text — and the tool decodes it back into the original bytes, works out what kind of image they are, shows you the picture, and offers it as a download with the correct file extension. The type detection deserves a mention: the tool does not take the prefix's word for it. It reads the first bytes of the decoded data — every image format starts with a recognizable signature — and reports the format it actually found. If the prefix claims PNG but the bytes are a JPEG, you get a JPEG, named .jpg, and the status line says the type was confirmed from the file signature.

Just as important is what happens with bad input. A great deal of Base64 found in the wild is damaged: copied from a web page with a chunk missing, line-wrapped by an email, or confused with something that was never Base64 at all. This tool validates the string before decoding — alphabet, padding and length — and then checks that the decoded bytes genuinely look like a PNG, JPEG, GIF, WebP or BMP. If either check fails, it tells you plainly instead of showing you a broken-image icon and leaving you to guess. (An earlier incarnation of this tool, inherited from a WordPress plugin, could never report an error at all: the bad input just silently produced nothing.)

How to decode Base64 into an image

  • Paste the string into the box. Surrounding spaces and line breaks are fine — they are cleaned up automatically.
  • Press Decode to Image. The picture appears as a preview, with its true format and file size in the status line.
  • Download with the correct extension already chosen for you.

Where do Base64 images come from?

Usually from places where a picture had to travel as text: an image embedded inline in an HTML page or an email, where the source shows a data URL instead of a file; an API response that returned an image as a Base64 field in JSON (extremely common with image-generation and photo-processing services); a database or log file where someone stored an upload as text; or a screenshot in a bug report, a forum post or a document where the picture was pasted as characters. In all of those cases the picture is fully there, just wearing a text costume — Base64 is a reversible encoding, not a transformation, so decoding restores the exact original bytes: same picture, same quality, same file size as before it was encoded. If you need to go the other direction, our Image to Base64 converter is the matching tool, and for ordinary text rather than images, the Base64 Encoder / Decoder handles strings both ways.

Frequently asked questions

My Base64 has no 'data:image…' prefix. Will it work?

Yes. The prefix is optional here. Paste the bare Base64 text and the tool detects the image type from the decoded bytes' own signature.

It says my string is not valid Base64. What went wrong?

Almost always a copy problem: the string was cut short at the start or end, a section is missing from the middle, or extra text got pasted in with it. Base64 uses only A–Z, a–z, 0–9, '+' and '/', ends with at most two '=' characters, and its length is a multiple of four — check the ends first.

Is the decoded image exactly the original?

Yes. Base64 is a lossless, reversible encoding. Decoding returns the identical bytes that were encoded — same format, same quality, same size.

Can this decode a Base64 PDF or other file?

The decoder validates that the result is a PNG, JPEG, GIF, WebP or BMP image and reports honestly when it is not — so a PDF will be recognized as 'not an image' rather than downloaded with a wrong extension.

Private by design: decoding happens entirely in your browser. The Base64 text you paste is never sent anywhere — which matters, because a pasted image can be as private as an uploaded one.