Base64
Base64 is an encoding scheme that converts binary data into a string of 64 printable ASCII characters. It uses letters A–Z, a–z, digits 0–9, plus (+), and slash (/) to represent every possible byte sequence, enabling safe transmission of binary data over text-based protocols.
Base64 is an encoding scheme that converts binary data into a string of 64 printable ASCII characters. It uses letters A–Z, a–z, digits 0–9, plus (+), and slash (/) to represent every possible byte sequence, enabling safe transmission of binary data over text-based protocols like HTTP, SMTP, and XML.
How It Works
Base64 groups input bits into 6-bit chunks (since 2^6 = 64) and maps each chunk to a character in the alphabet. Three input bytes (24 bits) produce four Base64 characters. If the input does not divide evenly by three, = padding is appended.
Variants
- Standard Base64: uses
+and/as the 62nd and 63rd characters - URL-safe Base64: replaces
+with-and/with_for use in URLs and JWT tokens - MIME Base64: wraps output at 76 characters for email compatibility
Common Uses
- HTTP
Authorization: Basicheader encoding - Data URIs for inline images in HTML/CSS
- JWT token payload encoding
- MIME email attachment encoding
- Embedding binary data in JSON
Important Note
Base64 is encoding, not encryption. Anyone can decode a Base64 string instantly with no key. It provides zero security — never use Base64 to "hide" sensitive information.
Size overhead: Base64 output is approximately 33% larger than the original binary input.
Use the Base64 Encoder/Decoder Tool to encode and decode instantly in your browser.