3tej home

What is Base32 Encoder / Decoder?

A Base32 Encoder / Decoder computes base32 encoder / decoder from the inputs you provide. It applies the standard formula to the values you enter and returns the result instantly, without sending any data to a server. RFC 4648 alphabet (A-Z, 2-7).

Base32 Encoder / Decoder

Encode and decode Base32 in your browser. RFC 4648 standard alphabet.

🔒 Browser-only ⚡ Instant 💸 Free forever 📡 Works offline 🚫 No signup
← Utilities

TLDR

Type or paste, click Encode / Decode. Standard RFC 4648 Base32 uses A-Z + 2-7 (no easy-to-confuse 0/1/8) with = padding. Useful for OTP keys, BIP-32 mnemonic prefixes, and case-insensitive transports.

Runs entirely in your browser. No upload, no signup, no logging. Output is for personal or commercial use; we don't claim any rights.

How to use this tool

  1. Enter your inputs. Each field is labeled with what it expects.
  2. Read the result instantly. Numbers update as you type or change inputs.
  3. Adjust to test sensitivity. Change one input at a time to see what moves the result most.
  4. Cross-check the formula in the section below if you want to verify the math.
  5. Copy or screenshot the result for later. The site does not save anything; close the tab and inputs are gone.

What Base32 is

Base32 is a binary-to-text encoding that represents arbitrary bytes using just 32 printable characters. The standard alphabet, defined in RFC 4648, is the 26 uppercase letters A to Z plus the digits 2 to 7. It deliberately omits 0, 1, 8, and 9 because they are easy to confuse with the letters O, I, B, and the like, which makes Base32 strings safer to read aloud, transcribe by hand, or print on a label.

The trade-off versus Base64 is density. Base32 packs 5 bits per character instead of 6, so the output is about 60 percent longer than Base64 for the same input. In exchange you get case-insensitivity (everything is uppercase) and a character set that survives being typed, dictated over the phone, or read off a screen without ambiguity. That is why it underpins TOTP and HOTP two-factor secret keys (the codes you scan into an authenticator app), base32-encoded onion addresses in Tor, and some DNS and filesystem-safe identifiers.

How the encoding works

Encoding treats the input as a continuous stream of bits and regroups it from 8-bit bytes into 5-bit chunks. Each 5-bit chunk (a value from 0 to 31) indexes one character in the alphabet. Because 8 and 5 share a least common multiple of 40, the encoder works in blocks of 5 input bytes (40 bits) that map to exactly 8 output characters:

encode: read bytes -> regroup into 5-bit groups -> map each to A-Z,2-7
        pad output to a multiple of 8 chars with '='
decode: strip '=' -> map each char to 5 bits -> regroup into 8-bit bytes
8 bytes in  -> 13 chars + padding   |   5 bytes in -> 8 chars (no pad)

When the input length is not a multiple of 5 bytes, the final block is short, so the encoder pads the output with one to six = characters to reach a multiple of eight. The decoder ignores that trailing padding. This tool auto-detects: if your input is only A to Z, 2 to 7, and =, it decodes; otherwise it treats the input as UTF-8 text and encodes it.

Worked example

Encode the three-character string foo (ASCII bytes 102, 111, 111).

  1. Write the bytes as bits: 01100110 01101111 01101111 (24 bits).
  2. Regroup into 5-bit chunks: 01100 11001 10111 101101 111, padding the last chunk with zeros to 11100.
  3. The five chunk values are 12, 25, 23, 27, 28.
  4. Map to the alphabet (A=0): M, Z, X, 3, 4, giving MZXW6... then pad to 8 chars.
  5. Final Base32: MZXW6===.
Result: foo encodes to MZXW6===. Three bytes became eight characters (five data characters plus three padding characters), illustrating the roughly 1.6x size increase.

Reference: alphabet and size growth

ValueCharValueChar
0-6A B C D E F G16-22Q R S T U V W
7-15H I J K L M N O P23-31X Y Z 2 3 4 5 6 7

Output length is always ceil(bytes / 5) x 8 characters including padding. So 10 bytes give 16 characters, 16 bytes give 32 characters, and 20 bytes give 32 characters. Compared with Base64, which yields ceil(bytes / 3) x 4, Base32 is consistently longer in exchange for its readable, case-insensitive alphabet.

Common mistakes and pitfalls

  • Confusing the alphabet with base32hex. RFC 4648 also defines an "extended hex" variant (0-9, A-V). It is not interchangeable with the standard A-Z, 2-7 alphabet; decoding one with the other gives garbage. This tool uses the standard alphabet.
  • Lowercase input. Standard Base32 is uppercase. Most decoders (including this one) accept lowercase by upcasing first, but a strict RFC decoder may reject it. Normalize to uppercase to be safe.
  • Stripping padding when a parser needs it. The = padding makes the length a multiple of eight. Some strict libraries require it; this tool adds it on encode and ignores it on decode.
  • Treating a TOTP secret as text. Authenticator secret keys are Base32-encoded random bytes, not words. Decode them to bytes, do not read them as a string.
  • Expecting Base64 length. Base32 output is about 60 percent longer than Base64. If a field is size-constrained, that difference can matter.

Related tools

Frequently asked questions

Is this tool free?

Yes - free forever, no signup, no daily limit.

Where does my input go?

Nowhere. The conversion runs entirely in your browser. Nothing is uploaded, stored, or logged.

Does it work offline?

After first load yes. The page caches in your browser and works without a connection.

Will it handle large inputs?

Yes up to several megabytes. The transforms are O(n) and the browser handles MBs in milliseconds.

Is the output exactly correct?

Yes - these are deterministic transforms with well-defined output. Same input always gives the same output.

Why does the round trip not produce byte-identical output for some inputs?

Some encodings are lossy on the second pass (e.g., trailing whitespace, BOM markers, or null bytes can be stripped). For binary-safe round trips use base64 or base32 which are designed to be lossless.

Is the encoded output safe to put in a URL?

Depends on the encoding. Base64 contains '+' and '/' which need URL-encoding; use Base64URL (in tools that offer it) for direct URL use. Hex, binary, and decimal are URL-safe by definition.

Can I encode/decode files instead of text?

Not on this page - the input box accepts text. For binary files use a dedicated tool that reads the file as bytes. Alternatively paste the file's contents if it is small.

How does this differ from the CLI tools (base64, xxd, od)?

Functionally identical for valid input. The CLI handles huge files better. This tool wins on convenience: paste a string, see the result in milliseconds, no terminal needed.

What encoding does the tool assume for text?

UTF-8 everywhere. The TextEncoder API encodes input strings as UTF-8 bytes, and TextDecoder reads them back. ASCII-only input works identically; non-ASCII characters use 2-4 bytes each in UTF-8.