Base32 Encoder and Decoder

Encode text to RFC 4648 Base32 and decode it back, with optional padding

Encode any text to standard RFC 4648 Base32 using the A-Z and 2-7 alphabet, or decode a Base32 string back to text. Optional = padding, whitespace-tolerant decoding, and clear error messages for invalid characters. Runs in your browser. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What alphabet does standard Base32 use?

RFC 4648 Base32 uses the 32 characters A through Z plus the digits 2 through 7. It deliberately omits 0, 1, 8, and 9 to avoid confusion with the letters O, I, and B, making the encoding safer to read aloud or transcribe by hand.

Base32 is a binary-to-text encoding that represents data using only the uppercase letters A to Z and the digits 2 to 7. This tool encodes text into that form and decodes it back, handling padding and stray whitespace for you.

How it works

Encoding reads the input bytes as a continuous stream of bits and slices it into 5-bit groups, mapping each group to one alphabet character:

alphabet = ABCDEFGHIJKLMNOPQRSTUVWXYZ234567   (index 0..31)
take 8 bits at a time, emit a character for every 5 bits accumulated
pad the final group with zero bits, then add '=' to reach a multiple of 8

Decoding reverses this: each character becomes its 5-bit index, the bits are re-concatenated, and every full 8 bits becomes one output byte. Leftover bits from padding are discarded.

Worked example and tips

The text Gera Tools (10 bytes) encodes to a Base32 string. Each 5 bytes of input becomes 8 characters of output, so 10 bytes fills exactly 16 characters with no padding needed. A 6-byte input would need 2 padding characters to reach the next multiple of 8.

Because the RFC 4648 Base32 alphabet deliberately excludes 0, 1, 8, and 9, it is the format behind TOTP authenticator-app secrets: you can dictate the key over the phone digit by digit without the listener confusing 0 and O or 1 and I. The same property makes Base32 reliable in DNS TXT records, where some systems quietly uppercase or lowercase text.

Base32 in context: when to choose it

FormatCase sensitivityAvoids look-alikesSpace overheadCommon use
Base64Case-sensitiveNo (uses +, /)~33%Email, data URIs, JWTs
Base32Case-insensitiveYes (A-Z, 2-7)~60%TOTP keys, file hashes, DNS
Base32HexCase-insensitivePartial~60%Sort-order–preserving IDs
Hex (Base16)Case-insensitiveN/A (digits + A-F)100%Byte dumps, cryptographic hashes

Choose Base32 when:

  • The output will be read or typed by a human
  • The system stores or transmits the value as case-insensitive text
  • You need the encoded form to survive email forwarding, DNS propagation, or legacy uppercasing middleware

If you are storing a value where length matters more than legibility, prefer Base64. If you need a URL-safe compact token, Base62 or URL-safe Base64 are better fits. Everything runs locally in your browser; nothing is uploaded.