What Is Base32? (And Why It's Different from Base64)
Base32 encodes binary data using 32 ASCII characters (A-Z, 2-7). Used for QR codes, TOTP secrets, and case-insensitive systems. Plain explanation with examples.
Short answer
Base32 encodes arbitrary binary data using just 32 ASCII characters: A–Z and 2–7. It's bigger than Base64 (uses 32 symbols instead of 64), but it has one important advantage — it's case-insensitive and avoids ambiguous characters (0/O, 1/I/L) — making it ideal for systems where users type the value, like TOTP authentication secrets and QR codes.
The Base32 alphabet (RFC 4648)
| Index | Char | Index | Char |
|---|---|---|---|
| 0 | A | 16 | Q |
| 1 | B | 17 | R |
| 2 | C | 18 | S |
| 3 | D | 19 | T |
| 4 | E | 20 | U |
| 5 | F | 21 | V |
| 6 | G | 22 | W |
| 7 | H | 23 | X |
| 8 | I | 24 | Y |
| 9 | J | 25 | Z |
| 10 | K | 26 | 2 |
| 11 | L | 27 | 3 |
| 12 | M | 28 | 4 |
| 13 | N | 29 | 5 |
| 14 | O | 30 | 6 |
| 15 | P | 31 | 7 |
Base32 vs Base64 — practical differences
| Base32 | Base64 | |
|---|---|---|
| Alphabet size | 32 chars | 64 chars |
| Characters used | A-Z, 2-7 | A-Z, a-z, 0-9, +, / |
| Output size | ~60% larger than input | ~33% larger than input |
| Case-sensitive? | No (a=A) | Yes (a≠A) |
| Ambiguous chars? | No (avoids 0,1,8,9 entirely) | Yes (0/O, 1/l/I) |
| URL-safe? | Yes | Standard variant has /+ — needs Base64URL variant |
| Best for | Human-typed secrets, QR codes | Binary in text contexts (HTTP headers, JSON) |
Where you'll encounter Base32
- TOTP / 2FA secrets — Google Authenticator, Authy, 1Password all use Base32 for the shared secret seed because users sometimes type it manually
- Onion services — Tor v3 onion addresses are Base32-encoded
- QR codes for short content — case-insensitive Base32 simplifies scanner correction
- Voice transmission — radio operators, customer-service phone codes — Base32 over a phone line works (no homonyms to confuse)
- DNS labels — DNS is case-insensitive; Base32 fits the constraint
Padding
Base32 output length is always a multiple of 8 characters. If the input doesn't divide evenly, the result is padded with = characters. Some implementations omit the padding (RFC 4648 allows both with/without).
Variants
- RFC 4648 Base32 — the standard (alphabet shown above)
- Crockford Base32 — different alphabet (excludes I, L, O, U); more human-friendly when read aloud
- z-base-32 — used in cryptography; reorders alphabet so common values get more readable letters
- Base32hex — extension that preserves sort order (rare, niche)
Common confusion
If a user reports a TOTP secret "doesn't work" but everything looks fine, they probably typed an O instead of 0 or I instead of 1. Base32 specifically excludes both ambiguous pairs to prevent this — but only if the system rejects those characters during entry.
Related tools
For Base64 (the more common encoding for binary in text contexts): Base64 encoder/decoder. Generate QR codes that use Base32-style content: QR code generator. Hash secrets before encoding: hash generator.
Featured Tools
Try these free tools directly in your browser — no sign-up required.
Base64 Encoder / Decoder
Encode text or decode Base64 strings instantly online. Convert between plain text and Base64 encoding for data URLs, authentication headers, and API tokens.
QR Code Generator
Create free QR codes instantly. Works for URLs, text, email, phone, WiFi. No signup, no watermark. Download as PNG or SVG in 1 click.
Hash Generator
Generate cryptographic hashes for any text using MD5, SHA-1, SHA-256, SHA-512, and more. Verify data integrity and create checksums instantly online.