Encode text to Base32 format
Encode text to Base32 format instantly with our free online Base32 encoder tool. This encoder helps developers and system administrators convert plain text and binary data into Base32 encoding for use in case-insensitive systems and data transmission. Simply paste your text and get the Base32-encoded output in real-time.
Base32 encoding converts binary data to text using 32 ASCII characters (A-Z and 2-7). Unlike Base64, Base32 is case-insensitive and avoids confusing characters, making it ideal for human-readable codes, secret keys, and environments where case matters.
Base32 groups input into 5-byte (40-bit) chunks, then splits into 8 groups of 5 bits each. Each 5-bit value (0-31) maps to one character: A-Z (0-25) and 2-7 (26-31). Padding with = ensures output length is multiple of 8.
RFC 4648 defines standard Base32 alphabet. 5 input bytes become 8 output characters (60% expansion). Variants: Base32hex (0-9, A-V), Crockford Base32 (excludes I, L, O, U to avoid confusion). Case-insensitive: ABC = abc.
Two-factor authentication apps use Base32 for secret key encoding.
JBSWY3DPEHPK3PXP (Google Authenticator)License keys, activation codes that users type manually.
Safe encoding for case-insensitive file systems (Windows).
No special characters means no URL encoding needed.
const BASE32_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';
function base32Encode(input) {
const bytes = new TextEncoder().encode(input);
let bits = '';
for (const byte of bytes) {
bits += byte.toString(2).padStart(8, '0');
}
// Pad to multiple of 5
while (bits.length % 5 !== 0) bits += '0';
let result = '';
for (let i = 0; i < bits.length; i += 5) {
const chunk = bits.slice(i, i + 5);
result += BASE32_CHARS[parseInt(chunk, 2)];
}
// Add padding
while (result.length % 8 !== 0) result += '=';
return result;
}
base32Encode('Hello'); // "JBSWY3DP"Convert to bits, group by 5, map to Base32 alphabet, add padding.
Use Base32 for TOTP secrets, human-readable codes, case-insensitive systems, and when users need to type encoded values. Use Base64 when compactness matters more.
Base32 is case-insensitive, avoids confusing characters (0/O, 1/l), and is URL-safe without encoding. Use it when humans need to read/type the encoded data. Base64 is more compact (33% vs 60% overhead).