Base64 Encoder & Decoder
Convert plain text to Base64 or decode a Base64 string back to its original form — instantly, in your browser, with zero data transmitted.
What is Base64?
Base64 is a binary-to-text encoding scheme that converts arbitrary binary data into a sequence of printable ASCII characters. It uses a 64-character alphabet consisting of A–Z, a–z, 0–9, and the symbols + and /, with = as a padding character.
The name "Base64" refers to the 64 distinct characters used in the encoding alphabet. Every 3 bytes (24 bits) of input data produce exactly 4 Base64 characters, resulting in roughly a 33% increase in size.
Why is Base64 Used?
Many legacy systems, protocols, and transport layers were designed to handle only ASCII text. Base64 solves the problem of transmitting binary data (images, files, cryptographic keys) through these text-only channels safely.
Common real-world use cases include:
- Email attachments: MIME encoding uses Base64 to embed images and files inline within email bodies
- CSS/HTML: Embedding small images as
data:URIs to eliminate HTTP requests - JSON Web Tokens (JWT): The header and payload are Base64Url encoded
- HTTP Basic Auth: Credentials are Base64-encoded in the Authorization header
- API keys: Binary keys are often distributed in Base64 format
Base64 vs Base64Url
Standard Base64 uses + and / as characters, which are reserved in URLs. Base64Url (used in JWTs and OAuth tokens) replaces + with - and / with _, making the output safe to include in URLs and filenames without percent-encoding.
ToolStaq's encoder uses standard Base64. For JWT decoding, a dedicated JWT decoder tool is recommended.
🔒 100% Private
All Base64 encoding and decoding runs using the browser's built-in btoa() and atob() functions. No data ever leaves your device, making this tool safe for encoding sensitive strings, API credentials, and configuration payloads.