1001Ferramentas
🔤 Utilities

Base32 Encode/Decode

Convert text between Base32 (RFC 4648) and UTF-8 in both directions. Useful for TOTP authentication tokens, keys and data compatible with Base32 systems.

Base32: when 32 characters beat 64

Base32 uses only uppercase letters A through Z and the digits 2 through 7. That makes it longer than base64 — roughly 60% growth against 33% — but it solves problems base64 does not: the result survives systems that ignore letter case, fits inside DNS labels, can be read out over the phone, and uses no character that needs escaping in a URL.

Type the text and the page returns the standard RFC 4648 encoding, padded with "=" at the end. The process groups the input bits five at a time, since 32 is two to the fifth, and each group becomes one letter. Because eight bits do not divide evenly by five, bits are left over at the end and filled with zeros — which is where the padding comes from, keeping the final block a multiple of eight characters.

The most common use today is the secret key for two-factor authentication: the TOTP secret is handed out in base32 precisely so it fits in a QR code and can be typed by hand when the camera fails. It also shows up in Tor .onion addresses, in filenames that must be case-insensitive, and in identifiers inside DNS zones.

Frequently asked questions

Why does the alphabet start at 2 rather than 0?
For the same reason as base58: 0 and O look alike, as do 1, I and l. Leaving out 0, 1, 8 and 9 leaves 26 letters plus six digits, exactly 32 symbols with no ambiguous pair.
Are the trailing equals signs required?
Under standard RFC 4648, yes, and that is what comes out here. Several practical uses drop the padding — a TOTP key is usually handed out without it, and most apps accept either form. If the destination complains, delete the trailing "=" characters; no information is lost.
Is this the same as base32hex?
No. There is a variant with the alphabet 0-9 followed by A-V, called base32hex, used in DNSSEC (NSEC3) because it preserves the sort order of the underlying data. It encodes the same bits with different symbols, so the results are not interchangeable.

Related Tools