What Base32 encoding does
Base32 turns arbitrary bytes into text made only of 32 safe characters. The encoder reads the input as UTF-8 bytes, splits them into 5-bit groups and maps each group to a symbol: A–Z for 0–25 and 2–7 for 26–31 in the standard RFC 4648 alphabet. Every 5 bytes become 8 characters, and a short final block is padded with =. The output matches the RFC 4648 test vectors: foobar encodes to MZXW6YTBOI====== and hello to NBSWY3DP.
How to decode Base32
Choose Decode (Auto-detect does it for input that contains only Base32 characters and padding) and paste the string. The Base32 decoder is lenient in the useful ways: lowercase letters, spaces, line breaks and missing = padding are all accepted, so a TOTP secret copied as jbsw y3dp ehpk 3pxp works. Characters outside the alphabet, or a length that cannot come from whole bytes (1, 3 or 6 leftover characters), produce an error. If the decoded bytes are not valid UTF-8 text — a binary key, for example — they are shown as hex instead.
Alphabets and padding
| Variant | Symbols for 0–31 | Used by |
|---|---|---|
| Standard (RFC 4648 §6) | ABCDEFGHIJKLMNOPQRSTUVWXYZ234567 | TOTP / 2FA secrets (Google Authenticator), onion addresses, most libraries’ default |
| base32hex (RFC 4648 §7) | 0123456789ABCDEFGHIJKLMNOPQRSTUV | DNSSEC NSEC3 hashes; keeps the sort order of the original bytes |
Uncheck = padding when the target expects unpadded Base32 (most authenticator apps, many URL-safe identifiers). Decoding never needs the padding.
Worked examples
| Input | Base32 (standard) | base32hex |
|---|---|---|
f | MY====== | CO====== |
fo | MZXQ==== | CPNG==== |
foo | MZXW6=== | CPNMU=== |
foob | MZXW6YQ= | CPNMUOG= |
fooba | MZXW6YTB | CPNMUOJ1 |
foobar | MZXW6YTBOI====== | CPNMUOJ1E8====== |
Base32 in code
Python
import base64
base64.b32encode(b"hello") # b'NBSWY3DP'
base64.b32decode("NBSWY3DP") # b'hello'
base64.b32hexencode(b"foobar") # b'CPNMUOJ1E8======' (Python 3.10+)
Command line (GNU coreutils)
printf 'hello' | base32 # NBSWY3DP
echo NBSWY3DP | base32 -d # hello
Common questions
How do I decode Base32 online?
Paste the Base32 string and choose Decode (Auto-detect switches automatically for input made only of Base32 characters). Lowercase, spaces and missing = padding are accepted; the bytes are shown as UTF-8 text, or as hex if they are not valid text.
What is the difference between Base32 and Base64?
Base32 stores 5 bits per character (about 60% larger than the input), Base64 stores 6 (about 33% larger). Base32 is case-insensitive and avoids + and /, so it is easier to read aloud or type — which is why TOTP secrets use it. For Base64, use the Base64 encoder.
Why does Base32 output end with = signs?
Base32 works on 5-byte blocks that become 8 characters; = fills a short final block to 8. Turn padding off if your system, such as an authenticator secret, expects Base32 without it.
What is base32hex?
The Extended Hex alphabet from RFC 4648 section 7: 0–9 then A–V, so encoded values sort in the same order as the original bytes. It is used in DNSSEC NSEC3 records.
Is my text uploaded?
No. Encoding and decoding run in your browser with TextEncoder and TextDecoder. Nothing is sent to a server.