"category": "dev-utility",
Base64 Decoder
"tldr": Paste Base64 and read it as text - handles missing padding, Base64url (-/_), and whitespace from logs automatically.
Decode Base64 back into readable text with UTF-8 interpretation, tolerantly: missing = padding is repaired, the URL-safe alphabet (- and _) is accepted alongside standard +/, and whitespace or line breaks from logs and MIME wrapping are stripped automatically.
The tolerance matters because real-world Base64 is messy - JWTs drop padding, email encodes in 76-character lines, and Kubernetes secrets copy with trailing newlines. A strict decoder rejects all of these; this one just decodes them.
How to decode Base64
- 1Paste the Base64 - from a header, token segment, secret, or log line.
- 2Whitespace is stripped, URL-safe characters normalized, padding repaired.
- 3Bytes are interpreted as UTF-8 text.
- 4If the output looks like gibberish, the data is binary - not text - or encrypted.
Convert Base64 to Text in code
import base64
s = "dXNlcjpww6Rzc3dvcmQt8J-OiQ"
s = s.replace("-", "+").replace("_", "/")
s += "=" * (-len(s) % 4)
print(base64.b64decode(s).decode())echo "dXNlcjpwYXNz" | base64 -dFrequently asked questions
The output is unreadable characters - is the tool broken?
The Base64 decoded fine, but the underlying bytes are not text: an image, a compressed blob, or ciphertext. Base64 wraps *any* bytes; only some of them are UTF-8 strings. Check the source - a data URI prefix or file signature usually reveals the real type.
Can I decode a JWT segment here?
Yes - each of the three dot-separated JWT parts is Base64url, which this decoder accepts directly. For the full decoded view with expiry checking, our JWT Decoder does all three segments at once.
Why do some decoders reject what this one accepts?
Strict RFC 4648 decoders require correct padding and the standard alphabet. This tool normalizes first because humans paste imperfect fragments. When *generating* Base64 for others, always emit strict standard form - be liberal in what you accept, conservative in what you produce.
Last updated:
You might also need
Free and in-browser, like everything on JSON Console. Browse all tools →