Base64 to file decoder

Decode Base64 to a file in your browser: nothing is uploaded, there is no limit on how much you decode, and the tool recognises the file type, previews images and text, and gives the download the right extension.

How it works

  1. Paste the text

    Paste the Base64 text, or choose a .txt file that contains it.

  2. Checked instantly

    You see at once whether the text is valid and what kind of file is in it.

  3. Download the file

    The file automatically gets the right extension.

What it accepts

Plain Base64, base64url (with - and _), text with line breaks or spaces, missing = padding, and data URIs such as data:image/png;base64,iVBORw0KGgo…. If something is wrong, you see exactly where: line and character.

A word of caution

Be careful with files you didn't expect. If you don't know what a decoded file is, don't open it on a computer that holds anything important.

Where do you find Base64 you need to decode?

Typical sources are a data:image/png;base64,… string copied from a web page or stylesheet, a file inside a JSON response, an attachment in a raw email, or an export from a database or API. Paste it as it is: the tool understands the data URI prefix, line breaks and spaces, base64url text and missing padding.

Reading the error messages

If the text is not valid Base64, the message names the line and character where it goes wrong, so you can spot a stray character or a cut-off string. A common cause is a copied value that was truncated in the middle, or one with quotes and a trailing comma from JSON still attached.

What if the file type is unknown?

The tool looks at the first bytes to recognise images, PDF, ZIP, audio and text. If it cannot, the download is a plain .bin file. You can rename it before saving, for example to .pdf if you know what it is. A ZIP can be opened afterwards with extract ZIP.

The reverse is file to Base64. For short snippets of text, Base64 to text is quicker.

Frequently asked questions

Does it accept a data URI?

Yes. Paste data:image/png;base64,… and the type in the prefix is used for the file.

Why does the tool say my Base64 is invalid?

It shows the position of the first wrong character. Check for a cut-off string, added quotes or a stray character from a copy and paste.

Can I decode a PDF or ZIP?

Yes. Any file type works. The tool recognises the common ones and gives the download the right extension.

Is my text uploaded?

No. Decoding happens in your browser, and neither the text nor the file leaves your device.