Skip to main content

RFC 4648 Base64 Decoder & Binary Reconstructor

Rate this tool 0 of 0 ratings
Additional page content: Editable from the admin panel -> tools content.

Programmatic Code Snippets: Base64 Decode String

How to implement Base64 Decode String programmatically in Python, Node.js, PHP, and CLI
CLI & API Syntax
Decode base64 string to utf-8 in Python 3
import base64

encoded_str = "SGVsbG8gV29ybGQhIFRvb2xib3gyNA=="
decoded_bytes = base64.b64decode(encoded_str)
decoded_text = decoded_bytes.decode('utf-8')
print(decoded_text) # Output: Hello World! Toolbox24
Decode base64 using native Buffer in Node.js / JavaScript
const encodedStr = "SGVsbG8gV29ybGQhIFRvb2xib3gyNA==";
const decodedStr = Buffer.from(encodedStr, 'base64').toString('utf-8');
console.log(decodedStr); // Output: Hello World! Toolbox24
Decode base64 string natively in PHP
<?php
$encoded_str = "SGVsbG8gV29ybGQhIFRvb2xib3gyNA==";
$decoded_str = base64_decode($encoded_str);
echo $decoded_str; // Output: Hello World! Toolbox24
Decode base64 in Linux / macOS Terminal
echo "SGVsbG8gV29ybGQhIFRvb2xib3gyNA==" | base64 --decode
# macOS alternative: echo "SGVsbG8gV29ybGQhIFRvb2xib3gyNA==" | base64 -D
Embed
Need this Base64 Decoder calculator on your website, lab portal, or research blog?
Free HTML Widget 100% Responsive Zero Cookie Tracking
Notice a calculation discrepancy, rounding error, or glitch?
Help us maintain 100% scientific precision and report any issues directly to engineering.