Base64 to image converter

Paste a Base64 string or a data URI, see a preview of the picture and download it as a file. Everything stays in your browser. Jump to the converter.

  • Free
  • No sign-up
  • Runs in your browser
base64-to-image

100% private — everything is converted in your browser and nothing is uploaded.

Files and images

Encode a file to Base64

100% private — everything is converted in your browser and nothing is uploaded.

How it works

Paste the Base64 or data URI

In the decode box of the Files and images section, paste the string. The data: prefix is optional.

Check the preview

If the data is an image, you see it at once, with its type and size.

Name and download

Choose a file name and download the picture with one click.

How to convert Base64 to an image

To convert Base64 to an image, paste the Base64 string, or the whole data URI, into the decode box of the Files and images section below the text converter. The picture appears as a preview together with its detected type and size, and the download button saves it with the file name you choose. It works with PNG, JPG, GIF, WebP and even PDF files, and nothing is uploaded.

How the file type is found

A Base64 string does not say what it contains, unless it comes with a data: prefix. The tool reads the first bytes of the decoded data, called the magic number, to recognise the type, so it can preview the picture and give it the right extension. Each type leaves a recognisable trace at the start of its Base64.

How common files begin in Base64

How Base64 files start
File typeBase64 starts with
JPEG/9j/
PNGiVBORw0KGgo=
GIFR0lGODlh
WebPUklGRg==
PDFJVBERi0=
ZIPUEsDBA==

Troubleshooting

  • Nothing appears. Make sure you copied the whole string, without quotes or a trailing comma from the code you took it from.
  • A broken picture. The string may be cut off. A truncated Base64 decodes to a damaged image.
  • Line breaks and spaces. They are tolerated, so you can paste a wrapped MIME block as it is.
  • An unknown type. The download still works; give the file the extension you expect.

Where these strings come from

Base64 pictures turn up in JSON responses from APIs, in HTML emails, in CSS files, in database exports and in browser developer tools. When you find one and want the actual file, this is the fastest way to get it, without writing a script or uploading it to an unknown service.

Private by design

The conversion runs in your browser. What you type, paste or drop is never uploaded, which matters when the text holds tokens, personal data or internal files.

Frequently asked questions

Can I convert a data URI, not only raw Base64?
Yes. Paste the full address starting with data:image/png;base64, or just the part after the comma. Both work.
Which file types can I get back?
Any type. Pictures such as PNG, JPG, GIF and WebP are previewed, and PDFs or other files are simply offered for download.
Is the picture sent anywhere?
No. The string is decoded in your browser and the file is created on your device.
Is this converter free?
Yes. There is no sign-up and no limit, and it runs in your browser, so nothing you type is sent to a server.
Does it work on a phone?
Yes. It works in any modern mobile browser, and the result updates as you type.