Why Base64 Exists
Many communication channels — email (SMTP), HTML, JSON, URLs — were designed to handle plain text only. Binary files (images, PDFs, certificates) contain arbitrary byte values including null bytes and control characters that break these channels. Base64 solves this by encoding any binary data into a safe 64-character alphabet.
The Base64 Alphabet
How Encoding Works
Base64 in Practice
- Data URIs: Embed images directly in HTML/CSS:
src="data:image/png;base64,iVBOR..." - JWT tokens: The header and payload sections are Base64URL encoded (uses
-and_instead of+and/). - Email attachments: MIME attachments are Base64 encoded before transmission.
- API authentication: Basic Auth sends
username:passwordas Base64.
Base64 Is NOT Encryption
This is the most common misconception. Base64 is an encoding, not encryption. It is completely reversible with zero secret keys. Never use it to secure sensitive data. Use TLS, AES, or bcrypt for security.
Size Overhead
Base64 increases data size by approximately 33% (4 output bytes per 3 input bytes). This is the trade-off for text-safe transmission.
Encode or decode any text or data to Base64 instantly — runs entirely in your browser.
Try the Base64 Encoder →