Base64 Encoder / Decoder
Encode and decode Base64 strings with UTF-8 support and Data URI mode. 100% client-side.
About This Tool
## Understanding Base64 Encoding
Base64 encoding converts binary data into a text representation using 64 printable ASCII characters. The encoding was originally designed for email (MIME) but is now used extensively in web development.
### How It Works
Base64 takes every 3 bytes (24 bits) of input and splits them into 4 groups of 6 bits. Each 6-bit group maps to one of 64 characters. If the input length is not divisible by 3, padding characters (=) are added.
### Common Use Cases
- **Inline Images**: Embedding small images in CSS or HTML using Data URIs eliminates additional HTTP requests, improving initial page load for small assets. - **JWT Tokens**: JSON Web Tokens use Base64URL encoding (a URL-safe variant) for the header and payload sections. - **API Payloads**: Binary file uploads in JSON APIs are often Base64-encoded since JSON doesn't support raw binary. - **Email Attachments**: MIME uses Base64 to encode binary attachments in email messages.