π Base32 Encoder and Decoder Online
By ToolNimba Editorial Team Β· Updated 2026-06-25
Type some text and press Encode.
This Base32 tool encodes text to Base32 and decodes Base32 back to readable text, both directions in one place. It uses the standard RFC 4648 alphabet (the uppercase letters A to Z and the digits 2 to 7) with = padding, and handles full UTF-8 so accented letters, emoji, and non-Latin scripts survive the round trip. Switch between Encode and Decode, copy the result with one click, or swap the output back into the input. Everything runs in your browser, so the text you paste never leaves your device.
What is the Base32 Encoder Decoder?
Base32 is a way of representing binary data using a set of 32 printable ASCII characters: the uppercase letters A to Z and the digits 2 to 7. The digits 0, 1, and 8 are deliberately left out because they are easy to confuse with the letters O, I, and B. That choice makes Base32 friendly for humans to read aloud, type, or write down, which is why it shows up in things like two-factor authentication secret keys and case-insensitive file identifiers. Base32 is one of three binary-to-text encodings defined in the same internet standard, alongside Base16 (hexadecimal) and Base64.
The encoding works at the bit level. Each Base32 character carries 5 bits of information, because 2 to the power of 5 is 32. The encoder reads the input as a stream of 8-bit bytes, lines all those bits up end to end, then slices the stream into 5-bit groups. Each group is a number from 0 to 31, which maps to one character in the alphabet. Since 8 bits and 5 bits share a least common multiple of 40 bits, the algorithm settles into neat blocks of 5 input bytes producing 8 output characters. When the input does not fill a whole 40-bit block, the final group is padded with zero bits and the output is padded with = characters so its length stays a multiple of 8.
The most common place people meet Base32 is two-factor authentication. When you set up an authenticator app such as Google Authenticator, Microsoft Authenticator, or Authy, the shared TOTP secret is delivered as a Base32 string (often inside a QR code as the "secret" parameter). Base32 is chosen here precisely because a human may need to type the secret by hand: the alphabet has no look-alike characters, it is case insensitive, and it travels safely through systems that uppercase or lowercase text. Decoding that Base32 secret back to raw bytes is the first step every authenticator performs before it runs the HMAC and time-step math that produces your 6-digit code.
Base32 is not the same as Base64, and it is not encryption. Compared with Base64 it uses a smaller alphabet, avoids look-alike characters, and is case insensitive, but it produces longer output: Base32 inflates data by about 60 percent, versus roughly 33 percent for Base64. The trade is deliberate. You give up compactness to gain something you can dictate over the phone or print on paper without ambiguity. Like all such schemes Base32 is fully reversible and uses no key, so anyone can decode it. It hides nothing.
There is more than one Base32 alphabet in the wild. The standard RFC 4648 variant (A to Z then 2 to 7) is what TOTP and most general tools use. A second variant, base32hex (sometimes called extended hex), uses 0 to 9 then A to V so that the encoded text sorts in the same order as the underlying bytes, which is why DNSSEC NSEC3 records rely on it. A third, Crockford Base32, drops the letters I, L, O, and U to make short identifiers even harder to misread and adds an optional check symbol. They are not interchangeable: a string encoded with one alphabet will decode to garbage under another, so you have to know which variant produced your data.
This tool first converts your text to UTF-8 bytes, then groups those bytes into 5-bit chunks by hand, and reverses the process on decode, so multibyte characters round-trip correctly. It accepts upper or lower case input on decode and tolerates strings whose = padding has been stripped, which is common when Base32 travels through URLs or config files. Because every step runs locally in JavaScript, you can paste TOTP secrets, API material, or private notes without any of it being uploaded to a server.
When to use it
- Reading or generating the secret keys used by TOTP authenticator apps (Google Authenticator, Authy, Microsoft Authenticator), which are shared in Base32.
- Producing case-insensitive identifiers that survive systems which do not preserve upper and lower case, such as file names, share links, and database keys.
- Encoding small binary blobs for environments where the + and / characters of Base64 would break URLs, file paths, or DNS labels but readability still matters.
- Decoding a Base32 string you found in a config file, QR code, or migration script to inspect the original text or bytes inside it.
- Teaching or learning how bit-level encodings group data, since Base32 blocks are short enough to trace by hand step by step.
- Sanity-checking a 2FA setup by decoding the Base32 secret to confirm it matches the expected raw key before trusting an authenticator.
How to use the Base32 Encoder Decoder
- Choose Encode to turn text into Base32, or Decode to turn Base32 back into text.
- Type or paste your content into the input box. The result updates as you type.
- Read the encoded or decoded result, including any = padding shown on encode.
- On decode, do not worry about upper or lower case or missing padding; the tool normalizes both.
- Press Copy to copy the result, or Swap input and output to feed the result back through the other direction.
Formula & method
Worked examples
Encode the word "Man" (3 bytes).
- ASCII bytes: M = 77, a = 97, n = 110.
- In bits: 01001101 01100001 01101110 (24 bits).
- Pad up to 25 bits, then slice into 5-bit groups: 01001 10101 10000 10110 11100 = 9, 21, 16, 22, 28.
- Map to alphabet: 9=J, 21=V, 16=Q, 22=W, 28=4, giving JVQW4.
- Pad the 5 characters out to a multiple of 8 with = signs.
Result: Man encodes to JVQW4===
Encode the single letter "M" (1 byte).
- ASCII byte: M = 77 = 01001101 (8 bits).
- Pad up to 10 bits with two zeros, then slice into 5-bit groups: 01001 10100 = 9 and 20.
- Map to alphabet: 9=J and 20=U, giving JU.
- One byte fills only 2 of the 8 characters, so add ====== padding.
Result: M encodes to JU======
Encode the 6-letter word "foobar".
- UTF-8 bytes: f o o b a r = 6 bytes = 48 bits.
- The first 5 bytes (40 bits) map to a full 8-character block: MZXW6YTB.
- The remaining 1 byte maps to OI and is padded with ======.
- Concatenate the two blocks.
Result: foobar encodes to MZXW6YTBOI======
Decode a TOTP-style secret back to text.
- Take the Base32 string ORSXG5A= (note the case-insensitive letters and trailing padding).
- Select Decode and paste it in.
- The tool maps each character back to 5 bits, reassembles 8-bit bytes, and drops the padding bits.
- The bytes are interpreted as UTF-8 text.
Result: ORSXG5A= decodes to the text "test"
The RFC 4648 Base32 alphabet (index to character)
| Index range | Characters |
|---|---|
| 0 to 9 | A B C D E F G H I J |
| 10 to 19 | K L M N O P Q R S T |
| 20 to 25 | U V W X Y Z |
| 26 to 31 | 2 3 4 5 6 7 |
| Padding | = |
How input length maps to padding (per final block)
| Input bytes left over (mod 5) | Base32 characters | Padding = |
|---|---|---|
| 0 (exact multiple of 5) | 8 | none |
| 1 | 2 | ====== |
| 2 | 4 | ==== |
| 3 | 5 | === |
| 4 | 7 | = |
Sample text and its Base32 encoding (RFC 4648 test vectors)
| Input | Base32 output |
|---|---|
| f | MY====== |
| fo | MZXQ==== |
| foo | MZXW6=== |
| foob | MZXW6YQ= |
| fooba | MZXW6YTB |
| foobar | MZXW6YTBOI====== |
Base32 variants compared
| Variant | Alphabet | Typical use |
|---|---|---|
| RFC 4648 standard | A to Z then 2 to 7 | TOTP 2FA secrets, general encoding |
| base32hex (extended hex) | 0 to 9 then A to V | DNSSEC NSEC3, sort-order preserving keys |
| Crockford Base32 | 0 to 9 and A to Z minus I L O U | Short human-readable IDs, optional checksum |
| z-base-32 | Reordered alphabet, no padding | Compact, easy-to-speak identifiers |
Size overhead: Base32 versus Base64 and hex
| Encoding | Bits per character | Size increase |
|---|---|---|
| Hex (Base16) | 4 | about 100 percent |
| Base32 | 5 | about 60 percent |
| Base64 | 6 | about 33 percent |
Common mistakes to avoid
- Confusing Base32 with Base64. They are different schemes. Base32 uses 32 characters (A to Z and 2 to 7) and is case insensitive, while Base64 uses 64 characters including lowercase, +, and /. Feeding Base64 into a Base32 decoder fails because the alphabets do not match.
- Including the digits 0, 1, or 8. Standard Base32 omits 0, 1, and 8 to avoid confusion with O, I, and B. If you see those digits, the data is not RFC 4648 Base32; it may be base32hex (which uses 0 to 9) or Crockford Base32.
- Mixing up the variants. A string encoded with base32hex or Crockford will not decode correctly under the standard RFC 4648 alphabet, and vice versa. Always confirm which variant produced your data before decoding it.
- Treating Base32 as encryption. Base32 hides nothing. Anyone can decode it instantly, so never use it to protect passwords, tokens, or private data. Use real encryption when you need secrecy.
- Dropping or mangling the = padding. RFC 4648 Base32 pads each final block with = so the length is a multiple of 8. Some systems strip padding, which can break strict decoders. This tool adds padding on encode and tolerates its absence on decode.
- Encoding text that was already binary. If your input is itself raw bytes (such as a downloaded key) rather than UTF-8 text, encoding it through a text box can mangle it. Use a tool or library that reads bytes directly when round-tripping non-text data.
Glossary
- Base32
- An encoding that represents binary data using 32 characters (A to Z and 2 to 7), chosen to avoid look-alike symbols and to be case insensitive.
- RFC 4648
- The internet standard that defines Base16, Base32, and Base64 encodings, including the exact Base32 alphabet and padding rules.
- base32hex
- A Base32 variant using the alphabet 0 to 9 then A to V, which preserves byte sort order and is used by DNSSEC NSEC3 records.
- Crockford Base32
- A human-friendly Base32 variant that removes the letters I, L, O, and U and supports an optional check symbol.
- TOTP
- Time-based One-Time Password, the 2FA scheme whose shared secret is distributed as a Base32 string for easy manual entry.
- Encoding
- A reversible transformation of data into another format. Unlike encryption it uses no key and provides no secrecy.
- Padding
- The = characters added to the end of Base32 output so its length is always a multiple of eight.
- UTF-8
- The dominant character encoding for text. It represents each character as one to four bytes, which Base32 then groups into 5-bit chunks.
Frequently asked questions
What is Base32 encoding?
Base32 encoding represents binary data using 32 characters: the uppercase letters A to Z and the digits 2 to 7. Each character carries 5 bits. It is reversible, case insensitive, and provides no encryption or secrecy, just a text-safe way to carry data.
How do I decode a Base32 string?
Paste the Base32 string, select Decode, and the original text appears instantly. This tool accepts upper or lower case and tolerates missing = padding, then returns the decoded UTF-8 text. To decode by hand, map each character to a 5-bit value, line up the bits, and regroup them into 8-bit bytes.
How is Base32 different from Base64?
Base32 uses a smaller, case-insensitive alphabet of 32 characters and avoids look-alike symbols like 0, 1, 8, +, and /. Base64 uses 64 characters and is more compact. Base32 output is about 60 percent larger than the input, while Base64 is about 33 percent larger. Use Base32 when text must be typed or read aloud, and Base64 when size matters.
Why do authenticator apps use Base32 for TOTP secrets?
TOTP secrets are shown in Base32 because users sometimes type them by hand. The alphabet has no confusable characters, it is case insensitive, and it survives copy-paste between systems that change case. The app decodes the Base32 secret back to raw bytes before running the HMAC and time-step calculation that produces your 6-digit code.
Is Base32 secure or encrypted?
No. Base32 is an encoding, not encryption. Anyone can decode it without a key, so it offers no security. Never use it to protect passwords or sensitive data. Use proper encryption such as AES when you need secrecy.
Why does Base32 output use padding with the = sign?
Base32 works in 40-bit blocks that produce 8 characters. When the input does not fill a whole block, the encoder adds = characters so the total length stays a multiple of 8. This keeps the format predictable for decoders. The number of = signs depends on how many bytes were in the last block.
What are base32hex and Crockford Base32?
They are alternative Base32 alphabets. base32hex uses 0 to 9 then A to V so encoded text sorts the same as the raw bytes, which DNSSEC NSEC3 relies on. Crockford Base32 drops I, L, O, and U to make short identifiers easier to read and adds an optional checksum. Neither decodes correctly under the standard RFC 4648 alphabet.
Does this tool handle emoji and accented characters?
Yes. It converts your text to UTF-8 bytes before encoding and decodes back through UTF-8, so characters like e-acute, umlauts, Japanese text, and emoji round-trip correctly without corruption.
Is my data uploaded anywhere when I use this tool?
No. All encoding and decoding happens locally in your browser using JavaScript. Nothing you paste, including TOTP secrets or private notes, is sent to a server, so it is safe to use for sensitive material.
Can I decode a Base32 string that has no padding or is lowercase?
Yes. This decoder uppercases the input and tolerates missing = padding, which is common when Base32 appears in URLs or config files. As long as the characters belong to the RFC 4648 alphabet, the original text is recovered.