About the Base32 Encode/Decode
Encode text to Base32 or decode a Base32 string back to readable text, following the standard RFC 4648 alphabet of A–Z and 2–7. Most people land here to check a 2FA secret or a Base32 value from a config file. It's also a clear worked example if you're learning how binary-to-text encodings work.
The result updates as you type, and the Include '=' Padding box decides whether the output ends in = signs. The conversion is worked out in your browser, so the text you paste isn't sent anywhere.
How Base32 encoding works
Your text is first turned into bytes using UTF-8, so accented letters, Urdu, Arabic or emoji take two to four bytes each. The bytes are then read as one long run of bits and cut into groups of 5. Each 5-bit group is a number from 0 to 31 that picks one character from the alphabet ABCDEFGHIJKLMNOPQRSTUVWXYZ234567.
Five bytes (40 bits) always become exactly eight characters. When the input doesn't fill a last group of five bytes, the final character is padded with zero bits and, with padding switched on, '=' signs are added until the length is a multiple of eight.
Decoding runs the same steps backwards: each character becomes its 5-bit value, the bits are joined and split into bytes, and the bytes are read as UTF-8 text. Padding is removed first and lowercase letters are treated as capitals.
1 character = 5 bits (2⁵ = 32 symbols: A–Z = 0–25, 2–7 = 26–31) 5 bytes = 40 bits = 8 characters Encoded length = ⌈ 8 × bytes ÷ 5 ⌉ characters, padded to a multiple of 8 with '=' Size increase = 8 ÷ 5 = 1.6× the original (60% larger)
Assumptions and limits
- Only the RFC 4648 standard alphabet is used. Variants such as base32hex (0–9, A–V), Crockford's Base32 and z-base-32 use different characters and won't decode correctly here.
- Decoded output is shown as UTF-8 text. If the Base32 holds binary data, such as a 2FA secret or a hash, you'll see stray symbols and replacement characters (�) instead of readable words.
- Spaces, hyphens and line breaks inside a Base32 string stop decoding with an "Invalid Base32 character" message; spaces at the very start or end are ignored.
- Padding is optional when decoding: strings with or without '=' give the same result. The digits 0, 1, 8 and 9 are not part of the alphabet.
Worked examples
Encode text to Base32
Typing "Hello World!" (12 bytes) gives 20 Base32 characters, plus four '=' signs to make 24 with padding switched on.
Input: Hello World! Padded: JBSWY3DPEBLW64TMMQQQ==== Unpadded: JBSWY3DPEBLW64TMMQQQ
Decode a Base32 string to text
Switch to Decode Base32 and paste nbswy3dpeb3w64tmmq (lowercase, no padding). The decoder treats it as uppercase and returns the text "hello world".
Looking inside a 2FA secret key
Authenticator app setup keys are Base32, often shown in groups of four with spaces. Remove the spaces first. The common sample key JBSWY3DPEHPK3PXP decodes to 10 bytes: "Hello!" followed by four bytes that aren't text, which appear as odd symbols. That's expected: real secrets are random bytes, so the text view only confirms the key is valid Base32.
Base32 examples, text to Base32 and back
The first six rows are the RFC 4648 test vectors. Read left to right to encode, right to left to decode.
| Text | Base32 (with padding) | Base32 (no padding) |
|---|---|---|
| f | MY====== | MY |
| fo | MZXQ==== | MZXQ |
| foo | MZXW6=== | MZXW6 |
| foob | MZXW6YQ= | MZXW6YQ |
| fooba | MZXW6YTB | MZXW6YTB |
| foobar | MZXW6YTBOI====== | MZXW6YTBOI |
| Hi | JBUQ==== | JBUQ |
| café | MNQWNQ5J | MNQWNQ5J |
| hello world | NBSWY3DPEB3W64TMMQ====== | NBSWY3DPEB3W64TMMQ |
How to use the Base32 Encode/Decode
- Choose Encode or Decode. Pick Encode Base32 to turn text into Base32, or Decode Base32 to turn a Base32 string back into text.
- Type or paste your input. When encoding, tick or untick Include '=' Padding; when decoding, paste the string with or without padding.
- Copy the output. The result appears in the Output Result box as you type; press Copy to put it on your clipboard.
Frequently asked questions
Should Base32 include '=' padding?
Only if whatever reads it expects padding. RFC 4648 adds '=' so the length is a multiple of eight, and some libraries insist on it. Many uses leave it out, including the secret in otpauth:// links for authenticator apps. Untick the padding option to match them; the decoder here accepts both forms.
Is Base32 case sensitive?
Not here. The standard alphabet is uppercase and this encoder always outputs capitals, but the decoder converts your input to uppercase first, so mzxw6 and MZXW6 both decode to "foo". That case-insensitivity is one reason Base32 is used where text may be retyped or lowercased.
Why does my Base32 string show an invalid character error?
Because only A–Z, 2–7 and '=' are allowed, and something else got in. The usual culprits are spaces or hyphens between groups, a 0 or 1 typed instead of the letters O and I, or a string that's actually Base64, which also uses the digits 0, 1, 8 and 9 and the symbols '+' and '/'.
How do I decode a Google Authenticator or 2FA secret key?
Remove the spaces, paste the key and choose Decode Base32. Because a TOTP secret is random bytes rather than words, the output will look like a few letters mixed with symbols. If no error appears, the key is valid Base32 with nothing mistyped.
What is the difference between Base32 and Base64?
Base32 uses 32 symbols and makes data 60% larger; Base64 uses 64 symbols and adds about 33%. Base32 is longer but uses only capitals and the digits 2–7, so it survives case-insensitive systems, file names and reading aloud better than Base64's mix of cases, '+' and '/'.
This tool runs entirely in your browser. What you enter or upload stays on your device and is never sent to our servers.