Base64 is one of the most common encoding schemes on the web. You've probably seen it in data URIs, JWT tokens, email attachments, and API responses. This guide explains what it is and how to use it.
1. What is Base64?
Base64 is a way to represent any binary data (images, files, encrypted text) using only 64 safe ASCII characters: A–Z, a–z, 0–9, +, and /. It's a "common alphabet" that survives systems that might mangle other characters.
2. Why use Base64?
Many text-based systems (JSON, XML, email headers, URLs) were designed for printable text. Base64 lets you safely embed binary data like images in these systems without corruption. It's not encryption — it's just encoding.
3. How to encode Base64
Open the Base64 Encoder / Decoder, paste your text, and click Encode. The tool returns a Base64 string. To decode, paste the Base64 string and click Decode.
4. Common uses
- Data URIs — embedding small images directly in HTML/CSS
- JWT tokens — the three parts of a JWT are Base64-encoded
- Email attachments — MIME uses Base64 to send binary files over text-only SMTP
- API responses — some APIs return Base64-encoded binary data in JSON
5. Base64 vs encryption
Base64 is not encryption. Anyone can decode a Base64 string instantly. Never use Base64 to hide secrets — use real encryption (AES, RSA) for that.