Base 32 Decoder
Decode Base32 to text, or encode text to Base32 — copy and paste the result.
This free online base 32 decoder converts Base32 (RFC 4648) strings to readable UTF-8 text — paste any Base32 string to decode it instantly, or encode text to Base32 with one click. Case-insensitive, ignores padding and whitespace automatically. No signup required, runs entirely in your browser.
Mode
Include padding
Pad the output to a multiple of 8 characters with =. TOTP/2FA secrets are usually unpadded.
Quick reference
- MZXW6YTBOI======
- → "foobar"
- MZXW6YTB
- → "fooba" (no padding needed)
- JBSWY3DP
- → "Hello"
- A–Z, 2–7
- the full alphabet (32 symbols)
What is Base32 encoding?
A base 32 decoder converts Base32-encoded strings back into readable text or raw bytes. Base32, standardized in RFC 4648, represents binary data using only 32 printable symbols: the uppercase letters A–Z and the digits 2–7. Each Base32 character encodes 5 bits, so every 5 bytes (40 bits) of input become 8 output characters.
Base32's defining feature is that it deliberately excludes ambiguous characters — 0, 1, and 8 are left out because they're easily confused with O, I/L, and B. Combined with being case-insensitive, that makes Base32 the format of choice anywhere a human might need to read or type an encoded value by hand: two-factor authentication (TOTP) secret keys, DNS labels (like .onion addresses), and file-system-safe identifiers.
Base32 trades compactness for readability — it expands data to 160% of its original size, versus Base64's 133%. The upside is an alphabet with zero ambiguous characters, which matters far more than a few extra bytes when a person is copying a code by hand.
How to decode Base32 to text online
Paste your Base32 string into the input area above with the mode set to Base32 → Text. The decoder is case-insensitive and strips whitespace and = padding automatically, so you can paste a value exactly as it appears in a QR code payload, config file, or API response. Each group of 8 Base32 characters decodes to 5 bytes, which are then interpreted as UTF-8 text.
If decoding produces an error, the most common cause is a character outside the Base32 alphabet — check for a stray lowercase letter that got auto-corrected to something else, or a digit like 0, 1, or 8 that shouldn't be there.
How to encode text to Base32
Switch the mode to Text → Base32 and type or paste any UTF-8 text. The encoder uses the browser's built-in TextEncoder to get the UTF-8 bytes, then packs them into 5-bit groups mapped to the Base32 alphabet. Toggle Include padding off if you need an unpadded value — most TOTP/2FA secret keys and many modern implementations omit the trailing = characters.
How to decode Base32 in Python, JavaScript & more
Use this tool for quick interactive decoding; use these snippets when you need Base32 inside a script.
Python
import base64
decoded = base64.b32decode("MZXW6YTBOI======").decode("utf-8")
print(decoded) # foobar
JavaScript (browser)
function base32Decode(str) {
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
const clean = str.toUpperCase().replace(/=+$/, "");
let bits = 0, value = 0; const bytes = [];
for (const c of clean) {
value = (value << 5) | alphabet.indexOf(c);
bits += 5;
if (bits >= 8) { bytes.push((value >>> (bits - 8)) & 0xff); bits -= 8; }
}
return new TextDecoder().decode(new Uint8Array(bytes));
}
base32Decode("MZXW6YTBOI======"); // "foobar"
Node.js
// npm i base32-decode (Node has no built-in Base32 codec)
const base32Decode = require('base32-decode');
Buffer.from(base32Decode('MZXW6YTBOI======', 'RFC4648')).toString('utf8'); // foobar
Base32 vs Base64 — which to use?
- Use Base32 when a human will read or type the value — TOTP/2FA secret keys, recovery codes, DNS names, file identifiers. Case-insensitivity and an unambiguous alphabet matter more than a few extra characters.
- Use Base64 when size matters and the value is only ever handled by machines — data URLs, JWTs, email attachments (MIME), API payloads.
Neither is encryption — both are reversible encodings with no secret key. Working with other encoded formats? See the Base64 Converter or the Hex Decoder.