Reading — step 1 of 5
Read
~1 min readVariants
Putting It All Together
You've built every layer:
| Layer | Lesson |
|---|---|
| Why base64 | 1 |
| Alphabet | 2 |
| Encode 3-to-4 | 3 |
| Padding | 4 |
| Decode 4-to-3 | 5 |
| Errors | 6 |
| Base64URL | 7 |
Beyond:
- Base85 (Ascii85): 4 bytes → 5 chars (vs 3 → 4 in base64). Smaller. Used in PDF and Git binary patches.
- Base91 / yEnc: even smaller for binary-in-text. Niche.
- Hex: simpler but 2x overhead instead of 1.33x.
- Base32 / Base32-Crockford: case-insensitive variants for human-typeable data.
- MIME quoted-printable: efficient for mostly-ASCII data with occasional binary.
When NOT to use base64:
- Files for which native binary works (HTTP body, gRPC)
- Storage (33% bigger)
- Hot loops (encoding overhead)
Where you've seen it:
- Email attachments (MIME)
- Data URIs (
data:image/...;base64,) - HTTP Basic auth
- JWT
- PEM-encoded keys/certificates
- TOTP secrets (Base32)
Discussion
Ask a question, share an insight, or help someone who’s stuck.
Sign in to post a comment or reply.
Loading…