Base64 Encode & Decode
Convert any text to Base64 encoding or decode Base64 strings back to readable text. Supports UTF-8 characters. All processing happens locally in your browser for maximum privacy.
How to Use the Base64 Encoder & Decoder
- Paste your text or Base64 string into the input field
- Click Encode to convert text to Base64
- Click Decode to convert Base64 back to readable text
- Copy the result with the copy button
What Is Base64 Encoding?
Base64 is a binary-to-text encoding scheme that represents binary data using a set of 64 ASCII characters. It converts every three bytes of input into four printable characters, making it safe to transmit binary data through text-only channels like email or JSON.
The encoding is essential whenever raw binary data — such as images, files, or cryptographic output — needs to be embedded in a text-based format. Without Base64, special bytes could be misinterpreted or stripped by protocols designed for plain text.
Despite its ubiquity, Base64 is purely an encoding and not a form of encryption. Anyone can decode a Base64 string instantly, so it should never be used to protect sensitive information.
Common Uses for Base64 Encoding
Embedding Images in HTML/CSS
Convert small images to data URIs so they load inline without additional HTTP requests, improving page speed for icons and sprites.
Email Attachments (MIME)
MIME encoding uses Base64 to embed binary file attachments inside plain-text email messages, ensuring safe delivery across mail servers.
JWT Tokens
JSON Web Tokens encode their header and payload sections as Base64URL strings, allowing structured auth data to travel in HTTP headers.
Data URLs in Web Applications
Encode fonts, SVGs, or small files directly into CSS or JavaScript bundles, reducing external dependencies during page rendering.
Tips for Working with Base64
Expect a 33% Size Increase
Base64 output is roughly one-third larger than the original binary. Avoid encoding large files inline where a direct URL would be more efficient.
Base64 Is Not Encryption
Encoding is fully reversible by anyone. Never rely on Base64 to hide passwords, API keys, or other secrets in your codebase.
Use URL-Safe Variants When Needed
Standard Base64 includes + and / characters that break URLs. Use the Base64URL alphabet (replacing them with - and _) for query strings and tokens.
Strip Padding When Size Matters
The trailing = padding characters are optional for many decoders. Removing them saves a few bytes in bandwidth-sensitive contexts like JWTs.
Encoding Methods Compared
| Method | Use Case | Size Overhead | Character Set |
|---|---|---|---|
| Base64 | Binary data in text channels | ~33% | A-Z, a-z, 0-9, +, / |
| URL Encoding | Special characters in URLs | Variable (up to 3x per char) | ASCII with %XX escapes |
| Hex Encoding | Debugging, checksums, color codes | 100% | 0-9, A-F |