Skip to content

Base64 to Image

Base64 to image

Paste a Base64 string or a full data URI and get the image back. It previews instantly with its format, byte size and pixel dimensions, and a download button saves it as a real file with the right extension. It runs in your browser, so nothing is uploaded.

Paste a Base64 string above to preview and download the image.

  • Files never leave your device
  • Runs in your browser
  • Free, no signup

How it works

  1. 1

    Paste the string

    Drop in a full data URI or a bare Base64 blob. Line breaks and spaces are ignored.

  2. 2

    Preview and check

    The image renders straight away with its format, size and dimensions so you can confirm it.

  3. 3

    Download the file

    Save it with the correct extension, ready to open in any viewer.

What this decoder gives you

Prefix optional

Paste a full data URI or just the raw Base64. The format is read from the prefix or detected from the bytes.

Format detected from bytes

The decoder inspects the file signature, so the download gets the right extension even with no prefix.

Decoded locally, never uploaded

The string is decoded and rendered in your browser, so pasted data never touches a server.

Where this helps

Frontend

Recovering an inlined image

Pull the real file out of a data URI you found in CSS or HTML.

Backend

Reading an API response

Turn a Base64 image field from a JSON payload into a viewable file.

Data

Inspecting a database value

Preview an image stored as a Base64 string in a record or config.

Testing

Debugging an upload

Confirm a Base64 blob really is the image you expect, with its true format and size.

Tips that help

  • 1

    Copy the whole string

    A truncated Base64 cannot be rebuilt. If it fails, the most likely cause is a value that was cut off when copied.

  • 2

    Prefix not required

    Bare Base64 works fine. The format is detected from the bytes, so you do not need the data: prefix.

  • 3

    Check the dimensions

    The reported width and height confirm you decoded the right image before you download it.

  • 4

    Need to encode instead?

    To create these strings, use the image or SVG encoder rather than this decoder.

Turning Base64 back into an image file

If you have a Base64 string or a data URI and need the actual image, decoding it is the reverse of inlining: the text becomes bytes again, which you can preview and save as a normal file. This guide covers what the decoder accepts, how it works out the format, and the common reasons a string fails to decode.

What you can paste

The decoder takes either a full data URI, the kind that starts with data:image/png;base64, or a bare Base64 blob with no prefix. Both are common: code and dev tools often hand you the whole data URI, while a config value or a database field might hold only the raw string.

Base64 to image

Ordinary whitespace and line breaks are ignored, so a string that was wrapped across lines when it was copied still works. What cannot be fixed is a string that was cut short, since the missing bytes are simply gone.

As soon as a valid string is in the box, the image renders, so you get immediate confirmation that you pasted the right thing.

How the format is detected

When you paste a full data URI, the MIME type in the prefix says what the image is. But the decoder does not rely on that alone: it also inspects the first few decoded bytes, the file's signature, to confirm the real format.

That signature check is why a bare Base64 string still works without a prefix. A PNG always begins with the same magic bytes, a JPEG with its own, and so on, so the format can be named from the content rather than a label.

Knowing the true format means the download gets the correct extension, so the saved file opens cleanly in any viewer.

When decoding fails

The usual culprit is an incomplete string. If only part of the Base64 was copied, it cannot rebuild the image, and the tool says so rather than saving a broken file. The fix is to copy the entire value again.

Read more

Another cause is pasting something that is not an image at all, such as Base64 of a text file or a JSON blob. The signature check will not recognise it as an image, which is the tool telling you the bytes are not what you expected.

If you need to create these strings in the first place, the image to Base64 tool encodes a file, and the SVG to Base64 tool handles SVG with the smaller URL-encoded form.

Frequently asked questions

Honest answers to what people ask before using this tool.

Further reading

Independent references if you want to go deeper on the formats and tradeoffs.