Base64 Engine
Convert text and binary data into the safe, text-based Base64 encoding. Essential for web APIs, data embedding, and email serialization protocols.
The Mechanics of Base64 Encoding
Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. By using a set of 64 characters (A-Z, a-z, 0-9, +, /), it allows binary data to be transmitted over systems that are designed to handle only text, such as Email (via MIME) or URLs.
Why Use Base64?
Safe Data Transport
Ensures data remains intact during transit through legacy systems that might interpret raw binary as control characters.
Embedding Media
Allows images, fonts, and icons to be embedded directly into HTML or CSS files using Data URIs, reducing HTTP requests.
JWT & API Keys
JSON Web Tokens and many API authentication headers use Base64URL encoding to transmit complex JSON objects safely in HTTP headers.
The Encoding Process
- Convert text to binary (ASCII values).
- Divide bits into groups of 6 (2⁶ = 64).
- Map each 6-bit group to its Base64 character.
- Add '=' padding to ensure the final length is a multiple of 4.
Security Warning
"Base64 is an encoding, not an encryption."
Never use Base64 to secure sensitive information like passwords. Anyone with access to the string can decode it instantly without a key. For security, always use hashing algorithms like Argon2 or encryption like AES.