Base32 Encode / Decode

How do I encode Base32?

How it is calculated

Base32 turns bytes into text made only of the letters A–Z and the digits 2–7. The tool takes the bytes of the input, joins their bits into one stream and cuts it into groups of 5 bits; each group (0–31) picks one character from ABCDEFGHIJKLMNOPQRSTUVWXYZ234567. If the last group is short it is padded with zero bits, and the output is padded with = to a multiple of 8 characters. Decoding reverses this: spaces and = are removed, letters are read case-insensitively, and any character outside the alphabet gives an invalid message. Base32 is an encoding, not encryption.

Worked example

Encode Hello. The five bytes are 48 65 6C 6C 6F, which is 40 bits: 01001 00001 10010 10110 11000 11011 00011 01111. These groups are 9, 1, 18, 22, 24, 27, 3, 15, which map to J, B, S, W, Y, 3, D, P. Result: JBSWY3DP. Because 40 bits divide evenly into 8 groups, no = padding is needed.

Try this example →

Common mistakes

  • Confusing Base32 with Base64. Base32 output is about 60% longer than the input and uses a different alphabet, so one cannot be decoded as the other.
  • Including the digits 0, 1, 8 or 9 in text to decode. They are not in the alphabet, so the input is reported as invalid.
  • Treating the result as protection for secrets. Anyone can decode it.
  • Dropping or adding a character when copying a code, such as an authenticator key, which shifts all following bits.
  • Forgetting that text is encoded as bytes, so accented letters use more than one byte and change the result.

Sources

About this calculator

This tool encodes arbitrary text into Base32, a scheme that represents binary data using only 32 characters (A–Z and digits 2–7), or decodes a Base32 string back into the original text. Compared to Base64, Base32 uses a smaller, case-insensitive alphabet that avoids visually confusing characters, which makes it more forgiving when it needs to be read aloud, typed by hand, or used somewhere that isn't reliably case-sensitive.

It's most commonly recognized as the format behind two-factor authentication secret keys (the string you type in manually if you can't scan the QR code for Google Authenticator or similar apps) and is also used in some DNS record encodings and file-naming schemes where a compact, unambiguous, alphanumeric-only representation of binary data is needed.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    Base32 is an encoding, not a way to keep anything secret. You will meet it mostly in authenticator app setup keys, where the secret is shown as letters A to Z and digits 2 to 7. The alphabet leaves out 0, 1, 8 and 9 on purpose to avoid mix-ups when typing by hand. Decoding ignores spaces, line breaks and = padding, and letter case does not matter. What are you using it for? Tell us which variant you need.

Popular calculators

All Calculators