Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 strings back to text. Fast, secure, and no data stored on servers.
What is Base64?
Base64 is a method of encoding binary data using a set of 64 printable ASCII characters. It's commonly used to encode data so that it can be transmitted over text-only channels, such as email or HTTP headers.
The name "Base64" comes from the fact that it uses 64 characters (A-Z, a-z, 0-9, +, /) to represent binary data. Every 3 bytes of binary data are converted to 4 characters in Base64.
Common Use Cases
- 📧Email Attachments: Binary files are Base64 encoded for email transmission
- 🔐Authentication: Basic HTTP authentication uses Base64 encoding
- 📊Data Serialization: Embedding binary data in JSON or XML documents
- 🖼️Image Embedding: Encoding images for use in data URIs or emails
- 🔗URL Safe: Encoding binary data for use in URLs
Base64 Character Set
Base64 uses 64 characters for encoding:
The equals sign (=) is used for padding to ensure the encoded string length is a multiple of 4.
How Base64 Works
- Take binary input: Start with binary data or text characters
- Group by 3 bytes: Divide the input into groups of 3 bytes (24 bits)
- Split into 4 parts: Divide each 24-bit group into 4 parts of 6 bits each
- Convert to decimal: Convert each 6-bit value to decimal (0-63)
- Map to characters: Use the Base64 alphabet to map each value to a character
- Add padding: Add equals signs if needed to make the result a multiple of 4
Encoding vs Decoding
Encoding
Converts plain text or binary data into Base64 format. Used to make data safe for transmission.
Decoding
Converts Base64 encoded text back to the original format. Reverses the encoding process.
Quick Reference
Text:
Hello
Base64:
SGVsbG8=
Text:
User:Pass
Base64:
VXNlcjpQYXNz
Important Notes
- ⚠️Base64 is encoding, not encryption. It's not secure for sensitive data.
- 💡The output is typically 33% larger than input
- ✅All processing happens in your browser