toooly-box

Base64 Decoder

Paste a Base64 string and read what it contains. Standard and URL-safe alphabets both work.

runs locally
Base64
Base64
Decoded text

That is not valid Base64.

What is a Base64 decoder?

A Base64 decoder reads the 64-character alphabet back into the original bytes and shows them as text. It needs no key and no password, because Base64 hides nothing: it is a way of writing bytes as text, not a way of protecting them.

How it works

The decoder turns the Base64 characters back into bytes, then reads those bytes as UTF-8 text.

URL-safe Base64 replaces + and / with - and _ so the value survives inside a URL. Both alphabets are accepted here, and padding may be missing without breaking the result.

If the output looks like noise, the input was probably not text to begin with: an image or a compressed file decodes to bytes no text reader can show.

What is a Base64 decoder

A Base64 decoder reverses the encoding: it reads the 64-character alphabet back into the original bytes, then shows you those bytes as text. If the bytes were text to begin with, a JSON payload, a JWT claim set, a password in an Authorization header, a value out of a Kubernetes secret, you get the original string back exactly, accents and emoji included, because the bytes are read as UTF-8.

If the bytes were never text, you will see a warning instead of nonsense. A Base64 string holding a PNG, a PDF or a zip archive decodes perfectly well, but there is no sensible way to display the result in a text box, so the tool tells you the input was valid Base64 carrying binary data rather than pretending otherwise.

Both alphabets, no switch needed

There are two Base64 alphabets in common use. Standard Base64 uses + and / for its last two characters and pads the end with = to a multiple of four. URL-safe Base64, which RFC 4648 calls base64url, uses - and _ instead so the string can sit in a URL path or query without escaping, and usually drops the padding.

You do not have to know which one you have. This decoder accepts both, treats - and _ as + and /, and restores missing padding itself, so a JWT segment copied straight out of a browser's network tab decodes without being tidied up first. Whitespace and line breaks are ignored too, which matters when the string was wrapped at 76 characters by an email client or a PEM file.

Why a decode fails

  • A character outside the alphabet the usual cause is a truncated copy that caught a quote, a comma or a closing brace from the surrounding JSON. Check the ends of the string first.
  • A length that cannot work Base64 encodes three bytes at a time into four characters, so a string of length 4n+1 cannot be valid, however it was produced.
  • A URL that was escaped twice if you see %2B or %3D in the string, you are looking at percent-encoded Base64. Decode the URL encoding first, then the Base64.
  • It was never Base64 hexadecimal, a UUID and a hash all look like opaque strings and are not Base64. A hex digest uses only 0–9 and a–f; Base64 mixes upper and lower case.

Decoding a JWT, carefully

A JSON Web Token is three base64url segments separated by dots: header, payload, signature. Paste the middle segment here and you get the claims as JSON, the issuer, the subject, the expiry, which is the fastest way to answer "is this token expired?" or "which account did the gateway think this was?".

Two cautions. The signature is not verifiable by decoding; checking that the token is genuine needs the signing key, which belongs on a server, not in a browser tab. And a token you can decode is a token anyone who intercepts it can decode: if what you just read in the payload would embarrass you in a log file, it should not be in the payload. Decoding here is safe in the one way that matters: the token stays on your machine, because the decode runs in the page and nothing is uploaded.

Questions people ask

What is URL-safe Base64?

A variant that uses - and _ instead of + and / so the value can sit in a URL without escaping. This decoder accepts both, and also tolerates missing = padding.

Why is the decoded output unreadable?

Because the original data was not text. Base64 can carry any bytes, including images and binaries, and those have no readable form.