FormatterHQ

Base32 Encode

Encode text as RFC 4648 Base32 — a case-insensitive alphabet of A–Z and 2–7 — with optional = padding.

Loading tool…
Ready.

How to use the Base32 Encode

  1. Type or paste into the Text box, or click Sample. You can also drop a text file on either box, or load one into the Base32 box with its Open file button.
  2. The Base32 box updates live as you type. It works both ways — edit the Base32 side to convert back, or click ⇄ Swap to exchange the sides.
  3. Adjust Include = padding in the options bar above the editors; the result refreshes immediately.
  4. Use Copy or Download on either box to take the result, or Clear to start again.

Base32 encode with the RFC 4648 alphabet

Base32 represents binary data using 32 characters: the letters A–Z and the digits 2–7. To Base32 encode text, this tool converts it to UTF-8 bytes and then writes every 5 bits as one character. Because the alphabet has no lowercase letters and avoids the easily confused digits 0, 1 and 8, Base32 survives being read aloud, typed by hand or handled by case-insensitive systems.

How Base32 works

  1. The input is split into groups of 5 bytes (40 bits).
  2. Each group is divided into eight 5-bit chunks, and each chunk selects one character from the alphabet.
  3. If the last group is shorter than 5 bytes, the output is padded with = to a multiple of 8 characters.

Every 5 bytes of input become 8 characters of output, so Base32 is about 60% larger than the original data — more than Base64 (33%), which is the price for a smaller, case-insensitive alphabet.

Example

Input:

Hello, Base32!

Output:

JBSWY3DPFQQEEYLTMUZTEII=

Without padding the result is JBSWY3DPFQQEEYLTMUZTEII. A two-byte input such as “Hi” shows the padding clearly: JBUQ====.

Where Base32 is used

  • Two-factor authentication. TOTP and HOTP secrets (RFC 6238 / RFC 4226) in authenticator apps and otpauth:// QR codes are Base32 strings, usually without padding.
  • Tor onion addresses are Base32 encoded in lowercase.
  • DNS-safe identifiers and file names on case-insensitive file systems.
  • Human-typed codes such as licence keys and recovery codes, where avoiding 0/O and 1/I confusion matters.

Base32 in code

Python has base64.b32encode() in the standard library, and GNU coreutils includes a base32 command (printf 'Hi' | base32). JavaScript and Node.js have no built-in Base32, so projects usually add a small library. All of them use the RFC 4648 alphabet shown here.

Padding or no padding?

RFC 4648 requires padding by default but allows specifications to omit it. TOTP secrets, onion addresses and many ID schemes drop the =. If a system rejects your value, try the other setting. Other variants — Base32hex (0–9, A–V) and Crockford’s Base32 — use different alphabets and are not interchangeable with the standard one produced here.

Decode with Base32 Decode, or compare with Base64 Encode and Base58 Encode. Encoding runs locally in your browser.

Frequently asked questions

What characters does Base32 use?
Standard RFC 4648 Base32 uses the uppercase letters A to Z and the digits 2 to 7, plus = for padding. The digits 0, 1, 8 and 9 are not used, which avoids confusing 0, 1 and 8 with O, I and B.
Why is Base32 output longer than Base64?
Each Base32 character carries 5 bits, while each Base64 character carries 6. Base32 therefore needs 8 characters for every 5 bytes, a 60% overhead versus Base64’s 33%.
Can I use this to create a TOTP secret?
You can encode existing bytes, but a real TOTP secret should be generated from a cryptographically secure random source, typically 20 bytes or more. Encoding a readable word gives a weak, guessable secret.
Is Base32 encryption?
No. Base32 is a reversible encoding that anyone can decode. It does not protect data.

Last updated October 3, 2026

Related tools