Base32 encoder and decoder

Base32 (RFC 4648) step by step, 5 bytes into 8 characters of 5 bits, with padding.

How it works

Base32 uses 32 characters, the capital letters A to Z and the digits 2 to 7 (0, 1, 8 and 9 are left out since they look like O, I and B). Each character carries 5 bits; since 5 bytes are 40 bits, a block of 5 bytes becomes exactly 8 characters.

A last block that is shorter needs 2, 4, 5 or 7 characters, filled with zero bits, and is padded with = signs up to 8. For example foobar becomes MZXW6YTBOI======. RFC 4648 also defines base32hex, with the alphabet 0 to 9 then A to V, which keeps the sort order of the data.

Base32 is 60% longer than the data, more than Base64, but it does not care about upper or lower case and has no signs that need escaping. It is used for the secrets of authenticator apps (TOTP), for Tor onion addresses and in DNSSEC.

Everything is calculated in your browser. Nothing you type leaves your device.