Base64 Decoder
Decode any Base64 string back to plain text or binary instantly. Handles standard Base64 and URL-safe Base64 (JWTs, OAuth tokens). 100% client-side.
Related Tools
Frequently Asked Questions
How do I decode Base64 in JavaScript and Python?▾
JavaScript (browser): atob('aGVsbG8=') returns the decoded ASCII string. For Unicode output: decodeURIComponent(escape(atob(str))). In Node.js: Buffer.from('aGVsbG8=', 'base64').toString('utf8'). For URL-safe Base64: Buffer.from(str, 'base64url').toString('utf8').
Python: import base64; base64.b64decode('aGVsbG8=').decode('utf-8'). For URL-safe input: base64.urlsafe_b64decode(str + '==').decode('utf-8') (padding may need to be added manually).
Terminal (macOS/Linux): echo 'aGVsbG8=' | base64 --decode
Why does my Base64 string end with == or =?▾
Base64 encodes 3 bytes at a time into 4 characters. When the input length is not a multiple of 3, padding characters (=) are added to make the output length a multiple of 4.
If the input has 1 leftover byte, two = characters are appended. If it has 2 leftover bytes, one = is appended. Inputs that are already a multiple of 3 bytes produce no padding. URL-safe Base64 (Base64url) often omits padding entirely — this is fine as long as the decoder knows to handle it.
What does 'invalid Base64' mean?▾
A Base64 string is invalid if it contains characters outside the expected alphabet. Standard Base64 uses A–Z, a–z, 0–9, +, / and = for padding. URL-safe Base64 uses - and _ instead of + and /.
Common causes: mixing standard and URL-safe alphabets (e.g. a JWT token pasted into a standard decoder), missing or extra padding (= signs), whitespace or line breaks inserted mid-string, or a truncated/corrupted value. Our decoder normalises URL-safe characters automatically, so - and _ are handled alongside + and /.
Can Base64 decode any file type?▾
Yes — Base64 is format-agnostic. It encodes raw bytes, so it can represent any file type: images, PDFs, audio, archives, executables. Decoding a Base64-encoded PNG gives back the original binary bytes of that PNG.
However, if you decode binary data as UTF-8 text you will see garbled characters — the output is binary, not a human-readable string. To recover the original file, decode the Base64 and save the result as a binary file with the correct extension.