Base32 encoder and decoder (RFC 4648)
Base32 encodes binary data using 32 case-insensitive characters — the uppercase letters A–Z and the digits 2–7 — defined in RFC 4648. Because it avoids ambiguous characters and is case-insensitive, it is ideal for values that may be typed by hand or read aloud, such as TOTP two-factor secrets and DNS-safe identifiers.
How it works
To encode, the tool converts your text to UTF-8 bytes, then treats those bytes as
one long bit stream and slices it into 5-bit groups. Each group (0–31) maps
to one alphabet character. Since 5 and 8 do not divide evenly, the output is
padded with = until its length is a multiple of 8. Decoding reverses the
process: each character contributes 5 bits, which are reassembled into 8-bit
bytes and decoded as UTF-8. The decoder upper-cases input and ignores whitespace
and padding.
Why 2–7 and not 0–9?
The RFC 4648 Base32 alphabet uses the digits 2 through 7 — skipping 0 and 1 — to avoid confusion with the letters O (looks like 0) and I or L (look like 1). The result is a 32-character alphabet where every symbol is unambiguous enough for a human to transcribe or speak. This is the key distinction from Base64, which includes both + and / and requires URL encoding.
Example
Encoding the text Gera:
Gera→ bytes47 65 72 61→I5SXEYI=(after padding)
| Input | Base32 encoded |
|---|---|
A | IE====== |
Hi | JBUQ==== |
Gera | I5SXEYI= |
Note the = padding characters at the end. Each = represents bits that were added to reach a complete 5-bit group; the decoder strips them before reconstructing the bytes.
The TOTP secret use case
TOTP authenticator apps (Google Authenticator, Authy, and others) store shared secrets as Base32-encoded strings. When you scan a QR code to set up two-factor authentication, the underlying data is a URL containing a Base32 secret. Tools for debugging or migrating TOTP configurations need to decode those secrets back to raw bytes. This encoder/decoder handles that round-trip: paste the Base32 secret to see its raw bytes, or paste raw bytes to get the Base32 form to re-encode.
Base32 vs alternatives
| Encoding | Alphabet size | Output overhead | Portable | Case-insensitive |
|---|---|---|---|---|
| Base32 (RFC 4648) | 32 | +60% | Yes (IETF) | Yes |
| Base64 | 64 | +33% | Yes (IETF) | No |
| Crockford Base32 | 32 | +60% | No (de facto) | Yes (with corrections) |
| Hex (Base16) | 16 | +100% | Yes | Yes |
Base32 is the right choice when compactness matters less than human-safety and DNS/case-insensitivity compatibility. For smaller overhead at the cost of URL-safety, use Base64url.
Everything runs in your browser — your data is never uploaded.