Xerobit

Base32 Decoder and Encoder

Use this base32 decoder to convert between plain text and Base32 encoded strings. Select encode to turn text into a Base32 string, or decode to reverse it. The tool follows RFC 4648, uses the standard uppercase alphabet, and runs entirely in your browser so nothing is uploaded.

RFC 4648 requires padding; some systems omit it.

Result

How to use the base32 decoder

  1. Choose Decode to convert a Base32 string to text, or Encode to convert text to Base32.
  2. Paste your input into the text area.
  3. Toggle the Include padding checkbox if you need output without trailing equals signs.
  4. The result updates automatically as you type.

How Base32 encoding works

Base32 represents binary data using a 32-character alphabet: the uppercase letters A through Z and the digits 2 through 7. Each character encodes exactly 5 bits of data. Because most text uses 8-bit bytes, the encoder groups the input into blocks of 5 bytes (40 bits), which map perfectly to 8 Base32 characters.

For example, the word foobar is 6 bytes long. The first 5 bytes (fooba) become MZXW6YTB. The remaining byte (r, binary 01110010) is split into two 5-bit groups: 01110 (14, which is O) and 01000 (8, which is I). The output is padded with six equals signs to reach a multiple of 8 characters, giving MZXW6YTBOI======.

RFC 4648 padding rules

The RFC 4648 standard requires that Base32 output length always be a multiple of 8 characters. When the input byte count is not a multiple of 5, the encoder adds padding characters (=) to fill the gap. The number of padding characters depends on the remainder:

Input bytes mod 5Data charactersPadding characters
00 or 80
126
244
353
471

This base32 converter lets you toggle padding off for environments like TOTP secrets or DNS records where the equals signs are stripped to save space.

Base32 vs Base64

Base64 uses 64 characters and encodes 6 bits per symbol, making it more compact than Base32. However, Base32 has practical advantages. Its alphabet avoids visually similar characters: there is no 0 (zero), 1 (one), 8, or 9, which prevents confusion with O, I, B, and G. This makes Base32 safer for manual transcription, printed codes, and case-insensitive systems.

The Base32 alphabet itself contains only letters and digits, so it is safe in URLs and file names, but the = padding character needs escaping in a query string, which is one reason padding is often left off. For general-purpose encoding where size matters most, use the Base64 tool instead.

Common uses for Base32

Base32 appears frequently in security and infrastructure contexts. Time-based One-Time Passwords (TOTP), used by authenticator apps for two-factor authentication, exchange secrets as Base32 strings. Geohash, a system for encoding geographic coordinates into short strings, uses a variant of the Base32 alphabet. Some DNS record types and file naming conventions prefer Base32 because it avoids special characters that could cause parsing issues.

If you are working with classical encryption rather than binary encoding, you may want a cipher decoder instead, which handles letter-substitution schemes.

Handling UTF-8 text safely

Base32 operates on raw bytes, not characters. When you encode text containing non-ASCII characters such as accented letters, emoji, or CJK scripts, the tool first converts the string to UTF-8 bytes. A single emoji like a smiley face becomes four bytes, which then expand into the corresponding Base32 characters. Decoding reverses the process: the Base32 string is converted back to bytes, and those bytes are interpreted as UTF-8. If the decoded bytes do not form valid UTF-8, which is normal for binary data, the tool shows the bytes as hex (for example 48 65 6c 6c 6f 21 de ad be ef) and says so, instead of producing garbled text. A TOTP secret such as JBSWY3DPEHPK3PXP is a typical case, since it holds random key bytes rather than text.

Worked examples

ExampleInputResult
Decode 'foobar'Direction: decode; Input: MZXW6YTBOI======; Include padding (=): yesfoobar
Encode 'foobar'Direction: encode; Input: foobar; Include padding (=): yesMZXW6YTBOI======
Encode without paddingDirection: encode; Input: Hello; Include padding (=): noJBSWY3DP
Decode empty stringDirection: decode; Include padding (=): yes
Decode a TOTP-style secret (shown as hex)Direction: decode; Input: JBSWY3DPEHPK3PXP; Include padding (=): yes48 65 6c 6c 6f 21 de ad be ef

FAQ

What characters does Base32 use?

Standard Base32 uses the uppercase letters A through Z and the digits 2 through 7, totaling 32 symbols. The digit 0, 1, 8, and 9 are excluded to avoid visual confusion with letters.

Can I decode a Base32 string without padding?

Yes. This base32 decoder accepts input with or without equals-sign padding. It normalizes the input internally before decoding.

Is Base32 case sensitive?

RFC 4648 specifies uppercase letters, but decoders typically accept lowercase input as well. This tool converts all input to uppercase before processing.

Why is my Base32 string longer than the original text?

Base32 encodes 5 bits per character while text uses 8 bits per byte. This means the encoded output is roughly 1.6 times the size of the input, plus any padding characters.

Does this tool upload my data to a server?

No. All encoding and decoding happens locally in your browser using JavaScript. Your input never leaves your device.

What is the difference between a base32 encoder and a base32 decoder?

An encoder converts plain text or binary data into a Base32 string. A decoder reverses the process, turning a Base32 string back into the original data. This tool handles both directions.

Why does my decoded Base32 show hex instead of text?

The decoded bytes are not valid UTF-8 text. That is normal for binary data such as TOTP secrets, keys and hashes. The tool shows the raw bytes as space-separated hex so you can still read them.