Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 strings back to text — browser-based, nothing sent to servers
When Base64 encoding is the right choice
Embedding small images in CSS/HTML
Icons under 5 KB are faster as inline Base64 data URIs than separate HTTP requests. Saves a network round-trip per image. Not recommended for images above 10 KB — the 33% size increase outweighs the benefit.
API authentication headers
HTTP Basic Auth encodes username:password as Base64 in the Authorization header. Most REST API clients do this automatically, but when debugging or building raw requests you need to encode manually.
Email attachments (MIME)
Email protocols (SMTP) are text-only. Binary attachments like PDFs and images are Base64-encoded in MIME format before transmission. Your email client decodes them automatically when you download an attachment.
Base64 is not encryption — anyone can decode it
A common misconception is that Base64 "hides" data. It does not. Base64 is a reversible encoding — any tool or browser console can decode it instantly with atob(). Never use Base64 to protect passwords, API keys, or sensitive data. If you need actual security, use encryption (AES-256, RSA) or hashing (SHA-256, bcrypt). Base64 is purely a format conversion tool.
Frequently Asked Questions
What is Base64 encoding?
Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It is commonly used to embed binary data in text-based formats such as JSON, HTML data URIs, and email attachments.
Is my data sent to a server?
No. All encoding and decoding runs entirely in your browser using the built-in btoa() and atob() JavaScript functions. Your text never leaves your device.
What is Base64 used for?
Base64 is used to encode images in CSS/HTML data URIs, encode credentials in HTTP Basic Authentication headers, encode binary data in JSON payloads, and encode email attachments via MIME.
Why does Base64 increase file size by about 33%?
Base64 encodes every 3 bytes of binary data into 4 ASCII characters. This 4:3 ratio means the output is always about 33% larger than the input. The trade-off is worth it when you need to embed binary data inside text-only formats.
Is Base64 the same as encryption?
No. Base64 is encoding, not encryption. Anyone can decode a Base64 string instantly — it provides zero security. Its purpose is format compatibility (making binary data safe for text channels), not confidentiality. Never use Base64 to protect sensitive data.
Key Terms
Base64
A binary-to-text encoding that represents data using 64 ASCII characters (A-Z, a-z, 0-9, +, /) plus = for padding.
Data URI
A scheme that embeds Base64-encoded data directly in HTML or CSS, eliminating the need for a separate file request.
MIME
Multipurpose Internet Mail Extensions — the standard that uses Base64 to encode email attachments for transmission over text-based email protocols.