Base64 Encoder & Decoder
Encode text or decode Base64 strings instantly in your browser.
About Base64 Encoding
Base64 is a binary-to-text encoding scheme that converts any data into a string of 64 printable ASCII characters (A-Z, a-z, 0-9, +, and /). It is one of the most widely used encoding standards on the web, appearing in everything from email attachments to API authentication headers and image data URIs.
Common Use Cases
- Data URIs: Embed small images, fonts, or icons directly into CSS and HTML — eliminating extra HTTP requests and improving page load performance.
- Email Attachments: The MIME specification uses Base64 to encode binary files (PDFs, images, ZIP archives) into text-safe payloads that SMTP servers can transmit without corruption.
- API Authentication: Basic Auth headers and JSON Web Tokens (JWTs) rely on Base64 encoding to safely transmit credentials and claims inside HTTP headers.
- Data Serialization: Storing binary data inside JSON, XML, or YAML documents — such as embedding a profile photo inside a database record — requires Base64 to avoid breaking the text format.
How Base64 Encoding Works
Base64 takes every 3 bytes (24 bits) of binary input and splits them into 4 groups of 6 bits. Each 6-bit group maps to one of 64 printable characters. If the input length is not divisible by 3, padding characters (=) are appended. The result is a string roughly 33% larger than the original, but completely safe for transport in any text-based system.
Encoding vs Encryption — Don't Confuse Them
Base64 is not encryption. Encoded data can be decoded by anyone with access to the string — there is no key, no secret, and no security. If you need to protect sensitive data, use encryption (like AES-256) first, then Base64-encode the encrypted output for transport. For hashing (one-way, irreversible), try our Hash Generator. For encoding URL parameters specifically, use our URL Encoder instead, as Base64 includes characters like + and / that are not URL-safe.
Free & Secure In-Browser Processing
Many online encoders send your input to a backend server for processing — a serious risk when working with authentication tokens, API keys, or proprietary data. ByteBox runs the entire encode/decode pipeline in your browser using JavaScript's built-in btoa() and atob() functions. Your text never leaves your device.