Base64 Encoder / Decoder
Encode any text to Base64 or decode Base64 back to readable text.
Used in email attachments, data URLs, authentication tokens, and API credentials.
What Is Base64? Base64 is a binary-to-text encoding scheme that converts binary data (raw bytes) into a sequence of 64 printable ASCII characters: A–Z, a–z, 0–9, plus (+), and slash (/), with equals (=) used for padding. The name comes from the 64 characters in the output alphabet. Every 3 bytes of input are converted into 4 Base64 characters, increasing the size by approximately 33%.
Why Base64 Exists Many communication protocols and file formats were originally designed to handle only 7-bit ASCII text — not arbitrary binary data. Email (SMTP), HTTP headers, XML, JSON, and HTML attributes all have restrictions on what characters they can contain. Base64 solves this by encoding any binary data as safe, printable text that travels through these systems without corruption.
Common Real-World Uses HTTP Basic Authentication sends username and password credentials as Base64 in the Authorization header: “Authorization: Basic dXNlcjpwYXNz” where “dXNlcjpwYXNz” is Base64 for “user:pass.” This is NOT encryption — it provides zero security on its own and requires HTTPS for protection. Data URLs embed files directly in HTML or CSS: an image tag can contain a Base64-encoded PNG directly in its src attribute, avoiding a separate network request. JWT (JSON Web Tokens) used for web authentication encode their header and payload as URL-safe Base64. SSH public keys and SSL/TLS certificates are stored and distributed as Base64-encoded text (the familiar “—–BEGIN CERTIFICATE—–” format).
URL-Safe Base64 Standard Base64 uses + and / which have special meaning in URLs. URL-safe Base64 (used in JWTs and many web APIs) replaces + with - (hyphen) and / with _ (underscore), making the encoded string safe to use in URL parameters without percent-encoding.
Base64 Is Not Encryption This is critically important: Base64 is an encoding, not encryption. Anyone can decode Base64 instantly — it provides zero confidentiality or security. Seeing Base64 in a URL or header does not mean the data is protected. For actual security, use proper encryption (AES, TLS) not Base64.
UTF-8 and Multi-byte Characters ASCII text encodes straightforwardly. Multi-byte Unicode characters (accents, non-Latin scripts, emoji) must be encoded as UTF-8 bytes first, then Base64-encoded. This calculator handles UTF-8 correctly — encoding emoji and international characters works properly.