Base64 Decoder & Encoder
Decode and encode Base64 online for free. Real-time conversion with full UTF-8 and emoji support. 100% private — runs in your browser. No signup needed.
What is Base64?
Base64 is a group of binary-to-text encoding schemes that represent binary data as a string of ASCII characters. Defined in RFC 4648, Base64 divides the input into groups of 3 bytes (24 bits), then splits those 24 bits into four 6-bit groups, each mapped to one of 64 printable characters: A-Z (0-25), a-z (26-51), 0-9 (52-61), + (62), and / (63). The = character pads the output when the input length is not a multiple of 3.
Base64 was originally designed to safely transmit binary data over channels that only support text, such as email (MIME) and early HTTP. Today it is ubiquitous: data URIs embed images in HTML, JWT tokens encode claims, PEM certificates wrap keys, and APIs transport binary payloads in JSON.
A Base64 encoder converts raw bytes to this safe ASCII representation, while a decoder reverses the process. Because each group of 3 input bytes produces 4 output characters, Base64-encoded data is approximately 33% larger than the original.
Use this free online Base64 converter to decode Base64 to text or encode text to Base64 instantly in your browser.
// Encode
btoa('Hello') // → 'SGVsbG8='
// Decode
atob('SGVsbG8=') // → 'Hello'
// UTF-8 safe encode
const bytes = new TextEncoder().encode('你好');
btoa(String.fromCharCode(...bytes));
// → '5L2g5aW9' Key Features
Real-Time Conversion
Encode and decode instantly as you type — no buttons to click, results appear immediately in the other area.
Full UTF-8 Support
Correctly handles Chinese, Japanese, Korean, Arabic, emoji, and any Unicode text via TextEncoder/TextDecoder.
Bidirectional
Type in either area: plain text on the left encodes to Base64 on the right, Base64 on the right decodes to text on the left.
100% Browser-Based
All processing happens locally in your browser. Your data never leaves your device — no server uploads, no tracking.
Error Detection
Invalid Base64 input is detected immediately with a clear error message, so you know exactly what to fix.
One-Click Copy
Copy encoded or decoded results to your clipboard instantly with the Copy button on each side.
Examples
Plain Text
Hello, World!
SGVsbG8sIFdvcmxkIQ==
Simple ASCII text encoded to Base64
UTF-8 Text
你好世界 🌍
5L2g5aW95LiW55WMIPCfjI0=
Chinese characters and emoji with proper UTF-8 encoding
JSON Data
{"user":"alice","role":"admin"} eyJ1c2VyIjoiYWxpY2UiLCJyb2xlIjoiYWRtaW4ifQ==
Encode JSON payloads for embedding in URLs or headers
Multi-line Text
Line 1 Line 2 Line 3
TGluZSAxCkxpbmUgMgpMaW5lIDM=
Base64 preserves line breaks and whitespace
How to Use
- 1
Enter Text or Base64
Type or paste plain text in the left area to encode, or paste a Base64 string in the right area to decode. Conversion is instant and bidirectional.
- 2
See Real-Time Results
The other area updates automatically as you type. Any errors (like invalid Base64) are shown immediately.
- 3
Copy the Result
Click the Copy button on either side to copy the encoded or decoded result to your clipboard.
Common Use Cases
- Data URI Generation
- Encode images or files to Base64 for embedding directly in HTML or CSS as data URIs.
- JWT Debugging
- Decode Base64-encoded JWT token headers and payloads to inspect claims and expiration times.
- API Development
- Encode binary data for transmission in JSON APIs, or decode Base64 responses for inspection.
- Email Encoding
- Encode or decode MIME-encoded email content and attachments.
- Certificate Inspection
- Decode PEM-encoded certificates and keys to examine their binary content.
- Configuration Embedding
- Encode configuration data or secrets for safe embedding in environment variables or config files.
Technical Details
- RFC 4648 Compliant
- Implements standard Base64 encoding as defined in RFC 4648, using the A-Z, a-z, 0-9, +, / alphabet with = padding.
- UTF-8 Via TextEncoder
- Uses the Web API TextEncoder to convert Unicode strings to UTF-8 bytes before encoding, ensuring correct handling of all scripts and emoji.
- Browser-Based Processing
- All encoding uses native btoa()/atob() with TextEncoder/TextDecoder — no external libraries, no server calls.
Best Practices
- Don't Use Base64 for Security
- Base64 is encoding, not encryption. Never use it to 'protect' passwords, tokens, or sensitive data — always use proper encryption.
- Watch the Size Increase
- Base64 adds ~33% overhead. For large files, consider binary transfer instead of Base64 encoding.
- Use UTF-8 Encoding
- Always encode text to UTF-8 bytes before Base64 encoding to ensure non-ASCII characters (Chinese, emoji) are handled correctly.
Frequently Asked Questions
What is Base64 encoding?
Is my data safe when using this tool?
How does this tool handle non-ASCII characters like Chinese or emoji?
Is Base64 encryption?
Where is Base64 commonly used?
What is the difference between Base64 and URL-safe Base64?
Why does Base64 increase data size?
How do I encode a file to Base64?
Can I use Base64 in HTML and CSS?
What is the maximum input size?
What characters are in the Base64 alphabet?
Related Tools
View all tools →JSON Formatter & Validator
Encoding & Formatting
Format, validate and beautify JSON instantly in your browser. Free online tool with syntax validation, error detection, minify and one-click copy. 100% private.
Number Base Converter — Binary, Hex, Decimal & Octal
Conversion Tools
Convert numbers between binary, hexadecimal, decimal, octal, and any custom base (2-36) instantly. Free, private, no sign-up — all processing happens in your browser.
Image Compressor
Conversion Tools
Reduce image size up to 80% — compress JPEG, PNG & WebP in your browser, no upload needed. Batch 20 images, adjust quality, compare before & after. Free & private.
Length Unit Converter — Metric, Imperial & More
Conversion Tools
1 inch = 2.54 cm, 1 foot = 0.3048 m, 1 mile = 1.609 km. Convert between 16 length units instantly — metric, imperial, nautical & astronomical. Free, private, runs in your browser.
MD5 Hash Generator & File Checksum Tool
Security Tools
Generate MD5, SHA-256, SHA-1 & SHA-512 hashes online for free — no signup, 100% in-browser. Hash text or files instantly, verify checksums, compare hashes, one-click copy. Your data never leaves your device.
Random Password Generator
Security Tools
Generate strong random passwords instantly — free, no signup, 100% in your browser. Customize length & character types, batch generate up to 50. Strength meter with entropy analysis.