Decode Base64 encoded text with UTF-8 support
Decode Base64 encoded strings instantly with our free online Base64 decoder tool. This decoder helps developers, security professionals, and data analysts convert Base64-encoded data back into readable plain text with full UTF-8 support. Simply paste your Base64 string and get the decoded output in real-time.
Base64 decoding reverses the encoding process, converting Base64 text back to its original binary form. This is essential for processing encoded data received from APIs, extracting embedded images, or reading email attachments. The decoder handles both standard and URL-safe Base64 variants.
The decoder maps each Base64 character back to its 6-bit value, combines four characters into three bytes, and outputs the original binary data. Padding characters (=) tell the decoder how many bytes to expect at the end. Invalid characters or incorrect padding will cause decoding errors.
Decoding reverses the 64-character mapping: A-Z map to 0-25, a-z to 26-51, 0-9 to 52-61, and + (or -) and / (or _) to 62-63. The decoder must handle both standard (RFC 4648) and URL-safe variants. Line breaks and whitespace should be stripped before decoding. Invalid input (wrong characters or incorrect length) should raise clear errors.
Many APIs return binary data (images, files) as Base64 strings in JSON responses.
Decoding a profile picture from {"avatar": "iVBORw0KGgo..."}Extract and save images embedded in HTML/CSS as data URIs.
Parse data:image/png;base64,... and save as PNG fileJSON Web Tokens consist of Base64URL-encoded header, payload, and signature.
Decode eyJhbGciOiJIUzI1NiJ9 to see {"alg":"HS256"}Extract and save attachments from MIME-encoded emails.
// Decode Base64 to string
const decoded = atob('SGVsbG8gV29ybGQ=');
// Result: "Hello World"
// For UTF-8 content (Unicode)
const utf8Decoded = decodeURIComponent(escape(atob(base64String)));
// Save as file
const binary = atob(base64Data);
const bytes = new Uint8Array(binary.length);
for (let i = 0; i < binary.length; i++) {
bytes[i] = binary.charCodeAt(i);
}
const blob = new Blob([bytes], {type: 'image/png'});atob() decodes Base64 to a string. For binary files, convert to Uint8Array for proper handling.
import base64
# Decode to string
decoded = base64.b64decode('SGVsbG8gV29ybGQ=').decode('utf-8')
# Result: "Hello World"
# Decode and save as file
with open('output.png', 'wb') as f:
f.write(base64.b64decode(base64_string))
# Handle URL-safe Base64
decoded = base64.urlsafe_b64decode(url_safe_string)b64decode returns bytes. Call .decode("utf-8") for text, or write directly to file for binary.
Use Base64 decode when you receive Base64-encoded data and need the original content - whether it's text, images, or other binary files. Essential for API integrations, email processing, and data URI extraction.
The decoded data might be binary (image, compressed file, etc.) displayed as text. Try saving it as a file with the correct extension. If it's supposed to be text, check if it was UTF-8 encoded before Base64 encoding.