Base64 Encoder & Decoder
Encode text or files to Base64 and decode Base64 strings online. Free, instant.
How to Encode or Decode Base64
1. Paste your text or Base64 string into the input box.
2. Click "Encode" to convert text to Base64, or "Decode" to convert Base64 back to readable text.
3. Copy the result with one click or clear and start again.
What is Base64 Encoding?
Base64 is a binary-to-text encoding scheme that converts binary data into a set of 64 printable ASCII characters. It is widely used in web development, email systems, and API communication to safely transmit data that might otherwise be corrupted during transfer. The encoding increases data size by approximately 33%, but ensures compatibility across all text-based protocols.
Common Use Cases for Base64
- Embed images in HTML/CSS: Use data URIs like
data:image/png;base64,...to inline images directly in code - API authentication: HTTP Basic Auth uses Base64-encoded credentials in the Authorization header
- Email attachments: MIME encoding uses Base64 to attach binary files to emails
- Storing binary data: Safely store binary content in JSON, XML, or database text fields
- Data URIs: Embed small files directly in web pages without extra HTTP requests
- JWT tokens: JSON Web Tokens use Base64url encoding for header and payload sections
FAQ
Is Base64 encryption? No. Base64 is an encoding, not encryption. Anyone can decode Base64 — it provides no security. Use it for data transport, not for hiding sensitive information.
Why does Base64 make files bigger? Base64 represents 3 bytes of binary data as 4 ASCII characters, increasing size by about 33%. This is a tradeoff for compatibility with text-based systems.
What characters does Base64 use? Standard Base64 uses A-Z, a-z, 0-9, +, and /. The Base64url variant replaces + and / with - and _ for safe use in URLs.
Can I encode files to Base64? Yes. Our tool supports text encoding. For files, you can use the browser's built-in FileReader API or command-line tools like base64.