/tools/base64-decoder

Base64 Decoder

Paste a Base64 string and get the original text back. Whitespace, missing padding and the URL-safe alphabet are all handled without extra settings.

Base64 DecoderRuns in your browser

How to use the Base64 Decoder

  1. Paste the Base64 string. Line breaks and spaces are stripped automatically.
  2. Press Decode. URL-safe characters and missing padding are corrected for you.
  3. Copy the text, or download it as a file if the content turns out to be binary.

Why decoding sometimes produces gibberish

Base64 carries no information about what the bytes mean. If the original data was a PNG, a ZIP or a protobuf message, decoding it produces exactly those bytes — which look like noise when displayed as text.

This tool detects that case. If the bytes are not valid UTF-8, it tells you so and offers a download instead of printing control characters into the page. A quick way to identify what you have: PNG files start with iVBOR in Base64, JPEGs with /9j/, PDFs with JVBER and ZIPs with UEsD.

Decoding JWTs

A JSON Web Token is three URL-safe Base64 segments joined by dots: header, payload and signature. Paste a single segment here — not the whole token — and you will get readable JSON back.

Two cautions. The signature segment is raw binary, so it will not decode to text. And decoding a payload proves nothing about the token's validity: anyone can read a JWT, and the signature is what makes it trustworthy. Never treat a decoded payload as verified.

Frequently asked questions

Why does it say the length is wrong?

Valid Base64 has a length that is a multiple of four once padding is added. If it is not, characters were lost — usually by a line-length limit in a chat client or a truncated copy.

Do I need to strip line breaks first?

No. All whitespace is removed before decoding, so you can paste MIME-wrapped output directly.

Does it detect URL-safe input automatically?

Yes. If the string contains a hyphen or underscore, those are converted to the standard alphabet and any missing padding is restored before decoding.

Can I decode a password hash with this?

No. Base64 is reversible encoding; a hash is a one-way function. If a value decodes to random bytes rather than text, it was probably a hash and cannot be reversed.

Related tools