Base64 is a group of binary-to-text encoding schemes that represent binary data in an ASCII string format. The term Base64 originates from a specific MIME content transfer encoding.
It is designed to carry data stored in binary formats across channels that only reliably support text content. In practice, this means converting unpredictable bytes (like images, compiled code, or special characters) into a safe, readable string using an alphabet of 64 characters (A-Z, a-z, 0-9, +, and /).
Common uses for Base64:
- Embedding small images directly into HTML or CSS without requiring an external image request.
- Encoding API keys or credentials in Basic Authentication headers.
- Safely passing complex strings in URLs or JSON payloads.
- Email attachments in the MIME specification.