Complete guide to Base64 encoding. Learn what Base64 is, why it's used for email attachments and data URIs, and how to encode and decode text and images online.
Base64 is a way to represent binary data using only printable text characters. It's not encryption (anyone can decode it) and it's not compression (the output is about 33% larger). It's a transport encoding - a way to get binary data through systems that only handle text.
Why Base64 Exists
Email protocols (SMTP) were designed for text only. Binary attachments like images needed a way to be transmitted as text. Base64 became the standard solution. Today it's used everywhere: email attachments (MIME), data URIs in HTML/CSS, JSON API responses carrying binary data, and more.
Our Base64 Encoder and Base64 Decoder handle text conversion instantly.
When You'll Use Base64
- Embedding images in HTML - Using data:image/png;base64,... URIs for small icons
- API development - Returning binary data (images, documents) as Base64 strings in JSON
- Email templates - Embedding images in HTML emails so they don't break when images are blocked
- Storing binary in databases - Storing small binary blobs as text columns
You can also convert images directly to Base64 with our Image to Base64 tool, or decode Base64 back to a viewable image with Base64 to Image.