Base64 to Base32 Converter
Convert Base64 to Base32 and Base32 to Base64 online. RFC 4648 compliant bidirectional encoder and decoder with file support.
About
Base64 and Base32 are binary-to-text encoding schemes defined in RFC 4648. Base64 uses a 64-character alphabet (A - Z, a - z, 0 - 9, +, /) and produces output at 133% of input size. Base32 uses a 32-character alphabet (A - Z, 2 - 7) and produces output at 160% of input size. The trade-off is case-insensitivity and human readability in Base32 versus compactness in Base64. Choosing the wrong encoding in API tokens, TOTP secrets, or data URIs causes silent authentication failures and data corruption that surface only in production.
This converter performs real byte-level transcoding. It decodes the source encoding into a raw byte array, then re-encodes into the target format. It does not perform naive character substitution. Note: this tool assumes standard Base32 per RFC 4648 Section 6. Extended hex (Base32-HEX) and Crockford variants are not supported. Pro tip: TOTP authenticator secrets (Google Authenticator, Authy) are always Base32. If you receive a Base64 key from a server, you must transcode it before provisioning.
Formulas
Base64 encodes every group of 3 bytes (24 bits) into 4 characters of 6 bits each. Base32 encodes every group of 5 bytes (40 bits) into 8 characters of 5 bits each. The transcoding process operates in two stages:
Output length for Base64:
Output length for Base32:
Where n = number of raw bytes. The padding count p for Base32 follows: if n mod 5 = 1 โ p = 6; if 2 โ p = 4; if 3 โ p = 3; if 4 โ p = 1; if 0 โ p = 0.
Reference Data
| Property | Base64 (RFC 4648 ยง4) | Base32 (RFC 4648 ยง6) |
|---|---|---|
| Alphabet Size | 64 characters | 32 characters |
| Characters Used | A - Z, a - z, 0 - 9, +, / | A - Z, 2 - 7 |
| Padding Character | = | = |
| Bits per Character | 6 | 5 |
| Encoding Group | 3 bytes โ 4 chars | 5 bytes โ 8 chars |
| Size Overhead | ~33% | ~60% |
| Case Sensitive | TRUE | FALSE |
| Human Readable | Low (confuses 0/O, 1/l) | High (no ambiguous chars) |
| Common Uses | MIME, Data URIs, JWT, PEM | TOTP, Onion addresses, GeoHash |
| URL Safe Variant | A - Z, a - z, 0 - 9, โ, _ | Same (inherently URL safe) |
| 1 byte input | 4 chars (2 padding) | 8 chars (6 padding) |
| 2 bytes input | 4 chars (1 padding) | 8 chars (4 padding) |
| 3 bytes input | 4 chars (0 padding) | 8 chars (1 padding) |
| 4 bytes input | 8 chars (2 padding) | 8 chars (0 padding) + partial |
| 5 bytes input | 8 chars (1 padding) | 8 chars (0 padding) |
| Max Line Length (MIME) | 76 | Not specified |
| Padding Requirement | Required per spec | Required per spec |
| Regex Validation | ^[A-Za-z0-9+/]*={0,2}$ | ^[A-Z2-7]*={0,6}$ |