What Is Base64?
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 /, with = used for padding. It is not encryption — anyone can decode Base64 with a single click — but it is perfect for transporting binary data through systems that only handle text.
Where Base64 Is Used
- Data URLs: Embedding images, fonts and small files directly inside HTML, CSS or JavaScript.
- Email (MIME): Attachments and embedded images are encoded as Base64 inside the message body.
- APIs and JSON: Transmitting binary payloads over text-based protocols.
- JWTs: JSON Web Tokens encode their header and payload as URL-safe Base64.
- Basic Authentication: The
Authorization: Basicheader sendsbase64(user:pass).
Base64 Size Overhead
| Input | Base64 Output | Overhead |
|---|---|---|
| 3 bytes | 4 characters | +33% |
| 1 KB | ~1.37 KB | +37% |
| 100 KB image | ~137 KB text | +37% |
| 1 MB file | ~1.37 MB | +37% |
URL-Safe vs Standard Base64
Standard Base64 uses + and /, which have special meaning inside URLs. URL-safe Base64 (also called Base64url) replaces them with - and _ and often strips the = padding. Use URL-safe Base64 whenever the encoded value will appear inside a URL, filename or JWT.
How to Use This Converter
- Text ↔ Base64: Paste or type text on the left, click Encode (or just watch it convert live), then copy the Base64 on the right.
- File → Base64: Drop any file on the upload zone. Enable data URI prefix if you want to embed it in HTML/CSS.
- Base64 → File: Paste a Base64 string or a full data URL and download the decoded file instantly.
Pro Tip: When inlining images, keep them under ~10 KB. Base64 inflates size by ~33%, so large images embedded as data URIs will bloat your HTML and hurt page speed. Prefer <img src="…"> for anything bigger.