Base32 Encode / Decode — RFC 4648, Base32Hex, Crockford & TOTP Secrets
Encode or decode Base32 across three alphabets — RFC 4648, Base32Hex (RFC 4648 §6) and Crockford — with an optional padding toggle, a TOTP/otpauth secret extractor, and file upload.
What is Base32 Encoder / Decoder & TOTP Secret Helper?
Base32 is a binary-to-text encoding that represents data using 32 characters (5 bits per character). Because it is case-insensitive and free of visually ambiguous characters, it is the standard choice for 2FA secrets and human-readable identifiers.
Zero-Server Tool Data Guarantee
All encoding, decoding, and otpauth:// parsing run locally in your browser. Your text, files, and TOTP secrets never leave your device — no server upload, no logging, no tracking.
How to Use
Pick a Mode
Encode turns text or a file into Base32; Decode turns Base32 back into readable text; TOTP Secret extracts a key from an otpauth:// URI.
Choose an Alphabet
RFC 4648 (default), Base32Hex (0-9, A-V), or Crockford (0-9, A-Z). The stats bar shows the resulting length.
Set Padding
Toggle '=' padding on or off. TOTP secrets and QR payloads are usually left unpadded.
Enter Input or Drop a File
Type, paste, or drop a text file (or an otpauth:// URI in TOTP mode). Output updates in real time.
Copy
Use the copy button to grab the encoded, decoded, or extracted result.
Common Use Cases
TOTP / Authenticator Secrets
Extract and decode the Base32 secret from an otpauth:// URI for Google Authenticator, Authy, and other 2FA apps.
QR-Code Payloads
Encode compact, case-insensitive data into QR codes where the alphabet must survive manual entry.
Base32Hex Key Identifiers
Use the RFC 4648 §6 alphabet for binary key IDs and DNS-safe identifiers with a natural digit-first sort order.
Crockford License / Invite Codes
Generate human-friendly codes that tolerate O/0 and I/1 transcription mistakes.
Case-Insensitive File Names
Encode binary data as filenames that survive case-folding on Windows and macOS.
Implementation Examples
// Generic Base32 encoder — RFC 4648 alphabet, optional paddingconst RFC4648 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';function base32Encode(bytes, pad = true) {if (!bytes.length) return '';let out = '', buffer = 0, bits = 0;for (let i = 0; i < bytes.length; i++) {buffer = (buffer << 8) | bytes[i];bits += 8;while (bits >= 5) { out += RFC4648[(buffer >>> (bits - 5)) & 31]; bits -= 5; }}if (bits > 0) out += RFC4648[(buffer << (5 - bits)) & 31];if (pad) while (out.length % 8 !== 0) out += '=';return out;}console.log(base32Encode(new TextEncoder().encode('hello'))); // "NBSWY3DP"console.log(base32Encode(new TextEncoder().encode('hello'), false)); // "NBSWY3DP" (no pad needed here)
Base32 vs Base64
| Feature | Base32 | Base64 |
|---|---|---|
| Character set | A-Z, 2-7 (32 chars) | A-Z, a-z, 0-9, +, / (64 chars) |
| Case sensitive? | No | Yes |
| Overhead | ~60% | 33% |
| Ambiguous chars | None (0/O, 1/I removed) | Possible |
| Padding | = (to 8-char blocks) | = (to 4-char blocks) |
| Best for | 2FA secrets, QR, DNS | Data transport, embedding |
Production Best Practices & Security
Frequently Asked Questions
Base32 is a binary-to-text encoding defined in RFC 4648. It uses 32 characters (A-Z and 2-7) to represent binary data, carrying 5 bits per character.
Because it is case-insensitive and excludes visually confusing characters like 0, 1, 8, 9, it is ideal for manual entry, voice communication, and systems that might mangle letter case. The trade-off is size: Base32 has roughly 60% overhead versus Base64's 33%.