Base32 Encoder & Decoder
Encode text or hex bytes to Base32 (RFC 4648) or decode Base32 back to text. Supports the standard and Base32hex alphabets, with or without = padding.
Base32 writes binary data using only 32 characters — the capital letters A–Z and the digits 2–7 — so the result survives case-insensitive systems, file names and being read aloud. It is the format of the secret keys behind authenticator apps (TOTP two-factor codes) and is defined in RFC 4648. This tool encodes UTF-8 text or raw hex bytes, and decodes Base32 back to text and bytes.
How to use this tool
- Choose Encode or Decode.
- Paste your text — or, for encoding, switch "Input is" to hex to encode raw bytes.
- Keep the standard alphabet unless your system says Base32hex (used, for example, in DNSSEC NSEC3 records).
- Untick padding if the receiving system wants no trailing = signs (most TOTP apps accept both).
Formula
Each 5 bytes (40 bits) are split into eight 5-bit groups; each group (0–31) selects one alphabet character.
A final partial group is filled with zero bits, and with padding on, = signs bring the length up to a multiple of 8. The output is 8/5 of the input size — 60% larger — compared with about 33% for Base64.
Example
Encoding the text "foobar" (6 bytes) gives MZXW6YTBOI======, the official test vector from RFC 4648. The first 5 bytes produce MZXW6YTB, the sixth byte "r" produces OI, and six = signs pad the result to 16 characters. With the Base32hex alphabet the same input becomes CPNMUOJ1E8======.
Frequently asked questions
Why does a 2FA secret look like JBSWY3DPEHPK3PXP?
Authenticator apps store the shared key as Base32 so people can type it in without confusing similar letters and digits. Decode it here to see the raw key bytes in hex.
Why are 0, 1, 8 and 9 missing from standard Base32?
RFC 4648 leaves out 0, 1 and 8 because they look like O, I/L and B. Only 2–7 are used as digits, which with 26 letters makes 32 symbols.
Is Base32 encryption?
No. It is a reversible encoding with no key — anyone can decode it. Use real encryption to protect data.
Does decoding care about lower case or spaces?
No. The decoder ignores spaces and line breaks, accepts lower case, and works with or without = padding.
Sources
Last updated: 2026-10-30