Base64 Encoder/Decoder
Encode text to Base64 or decode Base64 strings. UTF-8 safe, perfect for API authentication and data encoding.
What is Base64 Encoding?
Base64 is a binary-to-text encoding scheme that represents binary data using only 64 printable ASCII characters: A–Z, a–z, 0–9, +, and /. It was designed to safely transmit binary data over channels that only support text, such as email (SMTP) or HTTP headers.
Base64 does not encrypt your data — it simply transforms it into a different representation. Anyone who sees a Base64-encoded string can decode it instantly. It exists to ensure safe transport, not secrecy.
Every 3 bytes of input become 4 characters of Base64 output, meaning Base64-encoded data is approximately 33% larger than the original.
How to Use This Tool
- Paste your text or Base64 string into the input field.
- Click Encode to convert plain text → Base64, or Decode to convert Base64 → plain text.
- Click Copy Result to copy the output to your clipboard.
Common Use Cases
- HTTP Basic Authentication — Credentials are sent as
Authorization: Basic base64(username:password) - Data URLs — Embed images directly in HTML/CSS:
src="data:image/png;base64,..." - Email Attachments — MIME encoding converts binary attachments to Base64 for safe email transport
- JWT Tokens — JSON Web Tokens use Base64URL encoding for their header and payload sections
- API Payloads — Send binary data (images, files) inside JSON fields which only support text
- Config Files — Store binary certificates or keys as Base64 strings in YAML/JSON configs
Base64 vs Base64URL
Standard Base64 uses + and / which are special characters in URLs. Base64URL replaces + with - and / with _, making it safe for use in URLs, filenames, and JWT tokens without percent-encoding.
Frequently Asked Questions
=) are added to make the output length a multiple of 4. One = means 1 byte of padding was needed; == means 2 bytes. Padding is required by the standard but some implementations omit it.readAsDataURL() which returns a Base64 data URL suitable for embedding images directly in HTML.