🔐 RFC 4648 Base32 Encoder & Decoder

Encode text to Base32 or decode Base32 strings into plain text using standard RFC 4648 alphabet. Essential for two-factor authentication (2FA) OTP keys.

Free No Signup Required Browser-Based

A–Z then 2–7. The one you will meet almost everywhere, including TOTP secrets.

J5XGY2LOMVKG633MJB2WE4Y=

14 bytes in, 24 characters out — Base32 costs about 60% more space than the raw bytes.

Base32 packs five bits per character, so every five bytes become eight characters and the output is 60% larger than the input — worse than Base64’s 33%. The reason to accept that is human handling: the standard alphabet is case-insensitive and omits 0, 1 and 8, so it survives being read aloud, written down or typed from a screen without 0/O and 1/I/l confusion. That is why two-factor secrets are Base32 and not Base64. Note that Crockford’s Base32 is a third, different alphabet and is not RFC 4648 — it will not decode here. Everything runs in your browser; nothing is uploaded.

What RFC 4648 Base32 Encoder & Decoder Does

Base32 turns arbitrary bytes into text using 32 characters, packing five bits into each one. Five bytes become exactly eight characters, so the output is 60% larger than the input — noticeably worse than Base64, which costs 33%.

The reason to accept that penalty is human handling. The standard alphabet is A to Z and the digits 2 to 7: case-insensitive, and deliberately missing 0, 1 and 8 so that nothing can be confused with O, I, l or B. A Base32 string survives being read aloud down a phone, written on paper, or typed from a screen. Base64 does not — it is case-sensitive and contains both O and 0.

That is why two-factor authentication secrets are Base32. When an app shows you a code to type into another device by hand, the encoding has to tolerate human transcription, and the size penalty is irrelevant for twenty bytes.

RFC 4648 actually defines two alphabets. The standard one above, and an "extended hex" variant using 0 to 9 then A to V, whose useful property is that encoded strings sort in the same order as the bytes they represent. DNSSEC NSEC3 records use it for exactly that reason.

How to Use RFC 4648 Base32 Encoder & Decoder

  1. Select Encode or Decode mode
  2. Type or paste your string in the input field
  3. Click Copy Output to use in authentication or cryptographic systems

Formula Used by RFC 4648 Base32 Encoder & Decoder

Five bits per character

5 bytes (40 bits) → 8 characters × 5 bits; output length = ceil(bytes ÷ 5) × 8 with padding

padding
"=" fills the final group to eight characters; valid remainders are 0, 2, 4, 5 or 7 characters
overhead
8 ÷ 5 = 60% larger, against Base64's 4 ÷ 3 = 33%
case
the standard alphabet is case-insensitive on decode

Worked example

The five bytes "fooba".

  1. 40 bits divides evenly into eight groups of five
  2. Each group indexes the alphabet
  3. No padding needed, because the length is already a multiple of five

Result: MZXW6YTB — one of the RFC 4648 test vectors, and exactly eight characters.

RFC 4648 test vectors

The official conformance set. Any implementation should reproduce these exactly.

InputBase32
(empty)(empty)
fMY======
foMZXQ====
fooMZXW6===
foobMZXW6YQ=
foobaMZXW6YTB
foobarMZXW6YTBOI======

Base32 against the alternatives

EncodingAlphabetOverheadSuited to
Base16 (hex)0–9 A–F100%Debugging; unambiguous but bulky
Base32A–Z 2–760%Anything a person has to read or type
Base32 hex0–9 A–V60%Where sort order must match the bytes
Base64A–Z a–z 0–9 + /33%Machine-to-machine, where size matters
Base64urlA–Z a–z 0–9 - _33%URLs and filenames; no + or / to escape

How to Read Your Result

Encoding is not encryption

Base32 is reversible by anyone, with no key. It exists to move bytes safely through systems that expect text, not to conceal anything. A two-factor secret encoded in Base32 is a secret written in a different alphabet, and it should be protected exactly as carefully as the raw bytes.

Padding is often optional in practice

RFC 4648 requires "=" padding, but many implementations accept and emit unpadded strings, and TOTP secrets are commonly shown without it. Decoders should tolerate both; encoders should pad unless the consumer specifically does not want it.

Crockford Base32 is a different thing

It uses a third alphabet, excludes I, L, O and U, treats some characters as interchangeable on decode, and adds an optional check symbol. It is a sensible design and it is not RFC 4648 — a Crockford string will not decode correctly here, and vice versa.

Whitespace is formatting, not data

Base32 is routinely wrapped across lines in configuration files and emails. A decoder that treats a newline as an invalid character will fail on most real-world input, which is a surprisingly common bug.

Limitations & Accuracy Notes

  • Text input and output. Encoding an arbitrary binary file is not supported here.
  • Decoded bytes that are not valid UTF-8 are shown as hex, which is the honest representation for keys and hashes.
  • Crockford Base32 and z-base-32 are different alphabets and are not handled.
  • Very large inputs are limited by browser memory, since everything runs in the tab.
  • Nothing is uploaded — but a secret pasted into any web page should be treated as one to rotate.

Frequently Asked Questions

What is Base32 encoding used for?
Base32 uses a 32-character subset (A–Z and 2–7) designed to be human-readable and case-insensitive, widely used in Google Authenticator 2FA secret keys.
Why is Base32 preferred over Base64 for 2FA keys?
Base32 avoids confusing characters (like 0, 1, O, I) making manual typing and QR code error correction much more reliable.
Why does Base32 exist when Base64 is more compact?
Because its alphabet avoids characters that are easily confused when read or typed by a human — it is case-insensitive and excludes 0, 1 and 8. That makes it right for anything spoken aloud, printed, or entered by hand.
Where will I actually encounter Base32?
Two-factor authentication secrets are the most common case — the string behind a TOTP QR code is Base32. It also appears in onion addresses and in some file-sharing identifiers.
How much does Base32 expand data?
By 60%, since every five bytes become eight characters. Base64 expands by about 33%, which is the trade you make for human-readability.
Why does the output end in equals signs?
Padding to a multiple of eight characters, for the same reason Base64 pads. Some implementations omit it, so a decoder that rejects unpadded input will fail on perfectly valid data.
Is Base32 encryption?
No. Like Base64 it is a reversible encoding with no key, providing no confidentiality at all. A TOTP secret in Base32 is a plaintext secret in a readable format.
Is my data sent anywhere?
No. Encoding and decoding run in your browser, which matters given that the most common Base32 payload is an authentication secret.

References & Further Reading

By OnlineToolHubs Team • September 2026