Base64 decoder

Turn Base64 text back into text or a file.

Runs in your browser. Your files never leave your device.

How to decode Base64

  1. Paste the Base64 text.
  2. Choose text output, or file output to detect and download the original file.
  3. Copy the text or download the file.

Reading Base64 back into bytes

Decoding reverses RFC 4648 encoding: every 4 Base64 characters become 3 bytes. The alphabet is A-Z, a-z, 0-9, + and /, with = as end padding.

This tool accepts both the standard alphabet and the URL-safe one (- and _ in place of + and /) without needing to say which one it is, and adds back any padding you left off.

Text mode vs file mode

Text modeFile mode
Best forBase64 that encodes plain textBase64 that encodes an image, PDF or other binary file
OutputReadable text in the boxA detected file type and a download button
If you pick the wrong oneShows garbled charactersDownloads as a generic .bin file

File signatures this tool recognizes

First bytes (hex)File type
89 50 4E 47PNG image
FF D8 FFJPG image
47 49 46 38GIF image
25 50 44 46PDF document
50 4B 03 04ZIP archive

Anything else still decodes correctly. It downloads with a .bin extension since the exact format cannot be named from its bytes alone.

Where Base64 decoding is useful

  • Reading the payload of a JWT you have already split apart, or checking what an API embedded in a data URL.
  • Recovering a file from an email's raw source when an attachment will not save normally.
  • Debugging a webhook or log line that stores a value as Base64 instead of plain text.
  • Checking exactly what a suspicious email attachment or link parameter contains before opening it further.

Base64 in different contexts

Where you see itWhat it usually decodes to
Email attachment (MIME)The attached file's raw bytes
JWT payloadA JSON object of claims
Data URL prefixAn image, font or other embedded asset
Environment variable or secretA key, certificate or other config value

Base64 decode FAQ

Why does decoding fail?

Base64 only uses A-Z, a-z, 0-9, + and / (or - and _ for URL-safe). Extra characters, or text that was never Base64, will fail to decode.

Can it decode URL-safe Base64?

Yes. It accepts both the standard and URL-safe alphabets and adds back any missing padding automatically.

The decoded text looks like garbage. Why?

The Base64 probably encodes an image, PDF or other binary file, not text. Switch to file mode to detect the file type and download it.

Is the Base64 text sent to a server?

No. Decoding runs entirely in your browser.

What file types can file mode detect?

It reads the first bytes of the decoded data and recognizes common formats including PNG, JPG, GIF, PDF and ZIP by their signature. Anything else downloads with a generic .bin extension so you still get the exact bytes.

Why does my Base64 text have a data: prefix?

That is a data URL, which wraps Base64 with its MIME type, for example data:image/png;base64,. Remove everything before the comma and paste only the part after it.

Does padding with = signs matter?

No. Missing = padding is added back automatically, and the decoder accepts text with or without it.

Can I decode Base64 that has line breaks in it, like from an email attachment?

Yes. Whitespace and line breaks are stripped before decoding, since older formats often wrap long Base64 text at 76 characters per line under MIME's rules (RFC 2045).

Related tools