Base64 Decode

Decode Base64 or a data URL back to text, an image, a PDF or another file, with a preview and download. URL-safe Base64 works too. Free, nothing uploaded.

Runs in your browser. Your files are never uploaded. How it works

Base64 Decode turns Base64 back into what it was: readable text, an image you can see, or a file you can download. Paste plain Base64, URL-safe Base64 or a complete data: URL. The tool looks at the decoded bytes to work out what they are, so you do not have to know in advance. Everything runs in your browser.

How to decode Base64

  1. Paste the Base64 text or data URL into the box. It is decoded straight away.
  2. If it is text, the decoded text appears below, read as UTF-8 so every language works.
  3. If it is an image, you see a preview, and can download it.
  4. If it is another file, such as a PDF or a ZIP, the status line tells you its type and size. Click Download.

What it recognises

Type Formats
Images PNG, JPEG, GIF, WebP (with preview)
Documents PDF
Archives ZIP, gzip
Fonts WOFF, WOFF2, TTF
Text UTF-8 text; other data is offered as a binary download

The type comes from the first bytes of the decoded data, the “magic number” each file format starts with. For a data URL, the type written in the URL is used when the bytes are not recognised, for example for SVG images.

Where you meet Base64

  • Email source: attachments and some message bodies are Base64 with line breaks every 76 characters. Paste the block to get the file back.
  • API responses and JSON: files and images are often sent as Base64 strings. Use the JSON Formatter to find the field, then decode it here.
  • HTML and CSS: inline images written as data:image/...;base64,....
  • JSON Web Tokens: the header and payload are URL-safe Base64. Paste one part at a time.
  • Logs and configs: keys, certificates and binary blobs stored as text.

Errors and fixes

  • “This is not Base64”: the text contains other characters. Remove quotes, a variable name or a trailing comma copied along with it.
  • “The Base64 text is cut off”: part of the string is missing. Copy it again, all the way to the end.
  • “Binary data”: the bytes are not text and not a recognised file type. Download them and open the file with the program it belongs to.

Need the other direction?

To turn text into Base64, switch to Encode text. To turn an image into Base64 or a data URL, see Image to Base64. Base64 is not encryption: anything encoded can be decoded here, so never use it to hide passwords.

Frequently asked questions

How do I decode Base64?

Paste the Base64 text into the box. It is decoded as you paste: text appears as text, an image is previewed, and other files such as a PDF or ZIP can be downloaded.

Can I decode a data URL?

Yes. Paste the whole string starting with data:, for example data:image/png;base64,iVBOR... The prefix is removed automatically and the file type is taken from it when it cannot be recognised from the content.

Why do I get an error that it is not Base64?

The text contains characters that Base64 does not use, or it is cut off. Check that you copied the whole string, without quotes around it. Spaces and line breaks are fine; they are ignored.

Does it decode URL-safe Base64 and JWT parts?

Yes. URL-safe Base64 with - and _ and without = padding is decoded the same way. Paste the middle part of a JSON Web Token, between the two dots, to read its claims.

More ways to use Base64 Encode and Decode

Related tools