Base32 encode with the RFC 4648 alphabet
Base32 represents binary data using 32 characters: the letters A–Z and the digits 2–7. To Base32 encode text, this tool converts it to UTF-8 bytes and then writes every 5 bits as one character. Because the alphabet has no lowercase letters and avoids the easily confused digits 0, 1 and 8, Base32 survives being read aloud, typed by hand or handled by case-insensitive systems.
How Base32 works
- The input is split into groups of 5 bytes (40 bits).
- Each group is divided into eight 5-bit chunks, and each chunk selects one character from the alphabet.
- If the last group is shorter than 5 bytes, the output is padded with
=to a multiple of 8 characters.
Every 5 bytes of input become 8 characters of output, so Base32 is about 60% larger than the original data — more than Base64 (33%), which is the price for a smaller, case-insensitive alphabet.
Example
Input:
Hello, Base32!Output:
JBSWY3DPFQQEEYLTMUZTEII=Without padding the result is JBSWY3DPFQQEEYLTMUZTEII. A two-byte input such as “Hi” shows the padding clearly: JBUQ====.
Where Base32 is used
- Two-factor authentication. TOTP and HOTP secrets (RFC 6238 / RFC 4226) in authenticator apps and otpauth:// QR codes are Base32 strings, usually without padding.
- Tor onion addresses are Base32 encoded in lowercase.
- DNS-safe identifiers and file names on case-insensitive file systems.
- Human-typed codes such as licence keys and recovery codes, where avoiding 0/O and 1/I confusion matters.
Base32 in code
Python has base64.b32encode() in the standard library, and GNU coreutils includes a base32 command (printf 'Hi' | base32). JavaScript and Node.js have no built-in Base32, so projects usually add a small library. All of them use the RFC 4648 alphabet shown here.
Padding or no padding?
RFC 4648 requires padding by default but allows specifications to omit it. TOTP secrets, onion addresses and many ID schemes drop the =. If a system rejects your value, try the other setting. Other variants — Base32hex (0–9, A–V) and Crockford’s Base32 — use different alphabets and are not interchangeable with the standard one produced here.
Decode with Base32 Decode, or compare with Base64 Encode and Base58 Encode. Encoding runs locally in your browser.