Decode Base32 encoded text
Decode Base32 encoded strings instantly with our free online Base32 decoder tool. This decoder helps developers and system administrators convert Base32-encoded data back into readable plain text for data analysis and verification. Simply paste your Base32 string and get the decoded output in real-time.
Base32 decoder converts Base32-encoded text back to original binary data. Essential for reading TOTP secrets, processing license keys, and any application that receives Base32-encoded input. Handles padding and case variations.
Each Base32 character represents 5 bits. Decoder maps characters back to values (A=0 through 7=31), concatenates bits, groups into bytes, and converts to original data. Padding (=) is stripped first.
Decoder must handle: case normalization (A=a), padding removal, invalid character detection, and bit alignment. 8 Base32 characters become 5 bytes. Last group may have fewer bytes based on padding count.
Decode secret keys to generate time-based one-time passwords.
Decode user-entered license keys for verification.
Process Base32-encoded data from external systems.
Many 2FA QR codes contain Base32-encoded secrets.
const BASE32_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';
function base32Decode(input) {
// Remove padding and convert to uppercase
input = input.replace(/=+$/, '').toUpperCase();
let bits = '';
for (const char of input) {
const val = BASE32_CHARS.indexOf(char);
if (val === -1) throw new Error('Invalid Base32 character');
bits += val.toString(2).padStart(5, '0');
}
// Convert bits to bytes
const bytes = [];
for (let i = 0; i + 8 <= bits.length; i += 8) {
bytes.push(parseInt(bits.slice(i, i + 8), 2));
}
return new TextDecoder().decode(new Uint8Array(bytes));
}
base32Decode('JBSWY3DP'); // "Hello"Map characters to 5-bit values, concatenate, extract bytes, decode as text.
Use Base32 decoder when processing TOTP secrets, license keys, or any Base32-encoded data. Ensure you know which Base32 variant was used for encoding.
Common issues: wrong Base32 variant (standard vs hex vs Crockford), case sensitivity in your decoder, corrupted padding, or the data was double-encoded. Verify the encoding scheme used.