Decoding done properly
Base64 represents bytes, not text, so decoding produces bytes that then have to be interpreted. This tool decodes the bytes and reads them as UTF-8, so "w6k=" correctly becomes é instead of the mojibake "é" that the browser’s built-in atob() gives on its own.
It accepts the standard alphabet (A–Z, a–z, 0–9, +, /) and the URL-safe variant from RFC 4648 §5 (- and _ instead of + and /), ignores whitespace and line breaks, restores missing = padding, and strips a data:…;base64, prefix. If the bytes are an image, PDF or other binary, it says so and offers a preview or download instead of printing garbage.
Decode Base64 in code and on the command line
The same decoding in the languages you are most likely debugging:
echo -n "SGVsbG8=" | base64 -d # decode (macOS older: base64 -D) echo -n "Hello" | base64 # encode
Frequently asked questions
Why does my decoded text look garbled?
Either the data is binary (an image, a zip, encrypted data) rather than text, or it was text in an encoding other than UTF-8. The tool detects common binary formats and shows a hex preview for the rest.
Is Base64 encryption?
No. Base64 is an encoding anyone can reverse — as this page shows. Never use it to hide passwords or secrets.
How do I decode Base64 on the command line?
On Linux and macOS run echo -n "SGVsbG8=" | base64 -d (older macOS versions use -D). On Windows PowerShell use [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String("SGVsbG8=")). The section above has Python, JavaScript and Java versions.
How do I decode a JWT?
A JWT has three URL-safe Base64 parts separated by dots. Paste the first or second part (the header or payload) to read its JSON. The third part is a binary signature.
What does "Invalid length" mean?
Every 4 Base64 characters hold 3 bytes. A string whose length is one more than a multiple of four cannot be valid — a character was lost or added when copying.