Base64 Encode / Decode
Encode text to Base64 or decode Base64 to text
What it does: Encode text to Base64 or decode Base64 to text. This free online tool works entirely in your browser with no installation required.
- Type or paste the text you want to encode into the Text panel, or paste Base64 into the Base64 panel.
- Press the Encode button to convert text to Base64, or Decode to reverse the process.
- Use the copy button next to the Base64 panel to copy the result to your clipboard.
What is Base64?
Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It is commonly used when binary data needs to be transmitted over media designed to handle textual data. Base64 encoding transforms data into a sequence of 64 characters (A-Z, a-z, 0-9, +, /) plus the = padding character.
When to Use Base64 Encoding
- Email attachments (MIME) — Base64 is used to encode binary attachments in email messages so they can travel through SMTP servers that handle only text.
- Data URIs in web pages — Embed small images, fonts, or other resources directly in HTML or CSS using
data:URIs with Base64 encoding, reducing HTTP requests. - API authentication — HTTP Basic Authentication uses Base64 to encode username:password pairs (though this is not secure encryption; use HTTPS).
- JSON Web Tokens (JWT) — JWT header and payload sections are Base64-encoded JSON objects.
- Storing binary data in databases — Encode binary files as Base64 strings for storage in text-based database columns.
Important Notes
- Base64 is an encoding, not encryption. It provides no security — anyone can decode Base64 data easily.
- Base64 encoding increases data size by approximately 33% due to the overhead of representing binary data as text.
- Not all Base64 strings are valid — they must follow the correct character set and padding rules.
- URL-safe Base64 variants replace + with - and / with _ to work in URLs without escaping.