How Base32 packs bytes
Base32 reads input as a stream of bits and cuts it into 5-bit groups. Each group is a number from 0 to 31 that picks a symbol. Five bytes make 40 bits, which is exactly eight symbols, so output length grows by a factor of 8/5, about 60 percent larger than the input.
When the input is not a multiple of five bytes, the last group is padded with zero bits and, in the RFC alphabets, the output is padded with = to a multiple of eight symbols. One byte needs 6 padding characters, two bytes 4, three bytes 3, four bytes 1. Turn padding off to omit them; the decoder then accepts unpadded input as well.
- Base32 vs Base64: Base32 is longer but avoids lower case and symbols such as + and /.
- Base32 vs number base conversion: this tool encodes byte strings; it does not convert a number between radixes.