How Base64 works
Base64 takes 3 input bytes (24 bits) and turns them into 4 output characters (6 bits each). When the input length is not a multiple of 3, the encoder adds = padding so the output is always a multiple of 4 characters.
That means Base64 inflates size by ~33%. A 1 MB file becomes ~1.37 MB encoded.
Standard vs URL-safe
| Variant | Alphabet | Use |
|---|---|---|
| Standard (RFC 4648 §4) | A-Z a-z 0-9 + / | JSON, MIME, generic data interchange |
| URL-safe (RFC 4648 §5) | A-Z a-z 0-9 - _ | URLs, filenames, JWT tokens |
Common uses
- Embedding images directly in CSS or HTML via
data:image/png;base64,…URIs. - Sending binary attachments through email (MIME).
- Storing binary data in JSON or YAML configuration.
- Encoding credentials in HTTP Basic Auth headers.
- Carrying signed tokens like JWTs that must travel via URL or cookie.
FAQ
Is anything sent to your server?
No. All encoding/decoding (including file uploads) runs locally in your browser using the Web Crypto and FileReader APIs.
What is the max file size?
Limited only by your browser's available memory. Files up to ~50 MB encode comfortably; larger files may be slow but should still complete.
Can I decode a Base64 image back to a file?
This tool focuses on text output. To save decoded binary as a file, paste the Base64 into a data URI: data:application/octet-stream;base64,… and your browser will offer to download.