Base64 Decoder

Runs in browser Encoding

Decode standard or URL-safe Base64 into UTF-8 text, detect binary content, and download the decoded bytes as a file. Invalid characters are reported clearly.

Privacy: This tool runs entirely in your browser. Your input never leaves your device.
Loading tool…

How to use Base64 Decoder

  1. Paste the Base64 string (JWT segments and data: URIs work too).
  2. Read the decoded text and the notes about repairs performed.
  3. Switch the text encoding if the result shows � characters.
  4. Copy or download the result.

Base64 Decoder features

  • Decodes standard and URL-safe Base64, detecting the alphabet automatically
  • Repairs missing padding and ignores whitespace and data: URI prefixes
  • Reports invalid characters with positions; strict mode rejects them
  • Detects binary content and known file types, with a hex dump
  • Decode as UTF-8, Latin-1, UTF-16 LE or UTF-16 BE
  • Download the decoded text; live decoding as you paste

Base64 Decoder example

Decode a Base64url JWT payload

Input:

eyJzdWIiOiJ1c2VyXzhmM2EyYyIsInJvbGUiOiJhZG1pbiJ9

Output:

{"sub":"user_8f3a2c","role":"admin"}
Note: missing padding repaired (1 "=" added). Detected the URL-safe alphabet.

Frequently asked questions about Base64 Decoder

The string has no "=" at the end — will it still decode?

Yes. Missing padding is added automatically and reported in the notes, so Base64url values from JWTs and URLs decode without changes.

What happens with invalid characters?

By default characters outside the alphabet (and all whitespace) are skipped and listed with their positions. Enable "Strict" to reject the input instead — useful when validating data from another system.

The output shows � or strange symbols — why?

The decoded bytes are not UTF-8 text. They may be binary (an image, ZIP or PDF — the tool detects common signatures and shows a hex dump) or text in a legacy encoding; try "Latin-1" for the latter.

Can I decode a data: URI?

Yes. Paste the whole "data:image/png;base64,…" string; the prefix is removed and the content type is reported.

Technical notes

The decoder tolerates real-world input: it strips whitespace, accepts both alphabets, pads to a multiple of four and drops a dangling character when the length is invalid (mod 4 = 1). Binary detection looks for NUL bytes, a high ratio of control characters or invalid UTF-8 sequences, and file signatures identify PNG, JPEG, GIF, PDF, ZIP, gzip and more.