Skip to the content

Base32 Encoder/Decoder

Encode text to Base32 (RFC 4648) or decode it back. This is the alphabet used for two-factor authentication secrets.

Only need one direction? Base32 Encode and Base32 Decode have their own pages.

Share this tool:TwitterFacebookLinkedInWhatsAppEmail

What Base32 is

Base32 writes data with 32 characters: the letters A to Z and the digits 2 to 7. The digits 0, 1 and 8 are left out because they look too much like O, I and B. There are no lowercase letters and no punctuation, which makes Base32 easy to read aloud, type over and print.

How it works

Five bytes are 40 bits, which split into eight groups of 5 bits. Each group picks one of the 32 characters. Data that doesn't fill a group of five bytes is padded with = signs to a multiple of eight characters.

  • Hello is five bytes and becomes JBSWY3DP
  • Hi is two bytes and becomes JBUQ====

The result is 60% longer than the data. That is the price of the small alphabet: Base64 only adds 33%.

Where you run into it

  • Two-factor authentication. The secret key under the QR code of an authenticator app ("can't scan? enter this code") is Base32.
  • Onion addresses on the Tor network.
  • File names and identifiers on systems that don't tell upper and lower case apart, where Base64 would lose information.

What the decoder accepts

Lowercase letters, spaces, hyphens and missing = signs are all fine, so a key typed over in groups of four still decodes. Text is treated as UTF-8.

The alphabet is the standard one from RFC 4648. Some systems use other 32-character alphabets, such as Crockford's Base32 or the "base32hex" variant; those give different results and can't be decoded here.

See all 15