How to Base64 Decode
You have a Base64 string and need the original text. Here is how to decode it — online in seconds, or in Python, JavaScript, and the command line.
Method 1: Online (fastest)
Go to quicktoolshub.org/base64-encoder-decoder, switch to Decode mode, paste your Base64 string, and the decoded text appears instantly. Nothing is sent to a server.
Method 2: JavaScript (browser)
// Standard Base64
const decoded = atob('SGVsbG8gV29ybGQ=');
// → "Hello World"
// With Unicode support (for non-ASCII characters)
const decoded = decodeURIComponent(escape(atob('base64string')));Method 3: Node.js
const decoded = Buffer.from('SGVsbG8gV29ybGQ=', 'base64').toString('utf-8');
// → "Hello World"Method 4: Python
import base64
decoded = base64.b64decode('SGVsbG8gV29ybGQ=').decode('utf-8')
# → "Hello World"
# URL-safe Base64 (uses - and _ instead of + and /)
decoded = base64.urlsafe_b64decode('SGVsbG8gV29ybGQ=').decode('utf-8')Method 5: Command line
# Linux/macOS
echo 'SGVsbG8gV29ybGQ=' | base64 --decode
# Windows PowerShell
[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('SGVsbG8gV29ybGQ='))What Base64 actually is
Base64 is not encryption — it is a way to represent binary data using only printable ASCII characters. Binary data (images, files, arbitrary bytes) contains bytes that cannot safely pass through text-based systems like email or HTTP headers. Base64 solves this by encoding every 3 bytes of binary data into 4 printable characters using a 64-character alphabet (A–Z, a–z, 0–9, +, /).
The most common places you encounter Base64: data URIs in CSS (src="data:image/png;base64,..."), email attachments (MIME encoding), JWT tokens (the payload is Base64-encoded JSON), HTTP Basic Authentication headers (username:password encoded as Base64), and API responses that include binary data as a string. In all these cases, you need to decode the Base64 to get back the original data.
Why Base64 decoding fails
The most common errors when decoding Base64:
- Invalid characters — Base64 only allows A-Z, a-z, 0-9, +, / and =. Spaces, line breaks, or URL-encoded characters (%2B, %2F) cause failures.
- Missing padding — Base64 strings should have a length divisible by 4. If not, add = characters until the length is a multiple of 4.
- URL-safe vs standard — URL-safe Base64 uses - and _ instead of + and /. Use a URL-safe decoder for these strings.
- Wrong encoding — the decoded bytes might be a binary format (image, file), not valid UTF-8 text.
Decode Base64 now — free, instant
Paste any Base64 string and get the decoded output immediately. No sign-up, no server.
Open Base64 Decoder →Frequently asked questions
How do I decode Base64 online?
Go to quicktoolshub.org/base64-encoder-decoder, switch to Decode mode, paste your Base64 string and the decoded output appears instantly. The tool runs in your browser — no data is sent to a server.
How do I decode Base64 in Python?
Use the base64 module: import base64, then decoded = base64.b64decode('your_base64_string').decode('utf-8'). If the string uses URL-safe Base64 (- and _ instead of + and /), use base64.urlsafe_b64decode() instead. Add padding if needed: base64.b64decode(s + '==').
How do I decode Base64 in JavaScript?
In browsers: const decoded = atob('your_base64_string'). For Unicode support: const decoded = decodeURIComponent(escape(atob('your_base64_string'))). In Node.js: const decoded = Buffer.from('your_base64_string', 'base64').toString('utf-8').
Why does Base64 decoding fail with 'invalid character'?
Base64 strings can only contain A-Z, a-z, 0-9, +, / and = (for padding). If your string contains spaces, line breaks, or URL-encoded characters (%2B for +, %2F for /), the decoder will fail. Also check if the string uses URL-safe Base64 (- and _ instead of + and /) — this requires a URL-safe decoder.
What does Base64 padding (==) mean?
Base64 encodes 3 bytes into 4 characters. If the input length is not a multiple of 3, padding characters (=) are added to make the output length a multiple of 4. One = means one byte of padding, == means two bytes. Some implementations omit padding — if decoding fails, try adding == to the end of the string.
Is Base64 decoding the same as decryption?
No. Base64 is an encoding scheme, not encryption. Anyone can decode Base64 without a key. It is used to make binary data safe for text-based systems, not to protect data. If a Base64 string contains encrypted data, you still need the encryption key to read the underlying content even after decoding.