DevTools Logo

Base32 Encoder / Decoder

Base32 Encoder / Decoder

RFC 4648 & Crockford — encode, decode, hex mode

Runs in your browserRuns in your browser

Input

Output

Enter input to encode Base32

Try "foobar" → "MZXW6YTBOI======"

Try an example

About this tool

Encode text or bytes to Base32 and decode back, per RFC 4648: standard alphabet A–Z2–7, optional = padding, case-insensitive decoding, plus a hex input mode and Crockford variant toggle — the everyday need being TOTP secret seeds (e.g. Google Authenticator setup strings) and DNS TXT/DKIM key material. The mechanism is 5-bit ⇄ 8-bit bit-slicing: 5 bytes → 8 characters, with bit-aligned partial-block handling and strict/lenient decode modes.

How to use this tool

  1. Choose mode

    Select Encode (text → Base32) or Decode (Base32 → text/hex). The tool auto-detects from your input.

  2. Pick variant

    RFC 4648 (standard A–Z2–7) for TOTP/DNS. Crockford (excludes I L O U) for human-readable codes.

  3. Set options

    For encoding: choose padding and line-wrap. For decoding: strict/lenient mode controls padding/case validation.

  4. Enter input

    Type or paste text. For hex mode, enter hex bytes (e.g., 666f6f or 0x666f6f).

  5. Copy or download

    Output appears live. Use Copy button, download .txt, or swap direction to re-encode the result.

Frequently asked questions

What is the Base32 alphabet?

RFC 4648 uses A–Z and 2–7 (32 symbols). Crockford uses 0–9 and A–Z excluding I, L, O, U (also 32 symbols).

Why do TOTP secrets use Base32?

Base32 avoids lookalike characters, is case-insensitive, and fits efficiently in QR codes. RFC 4648 is the standard for TOTP (RFC 6238).

Why is there padding (=)?

RFC 4648 pads to 8-character blocks so decoders know the exact bit-length. Crockford omits padding by design.

What is Crockford Base32?

A variant by Douglas Crockford that removes ambiguous characters (I, L, O, U) for safer human transcription. It's used in some APIs and identifiers.

Why does Base32 output longer strings than Base64?

Base32 encodes 5 bits per character vs Base64's 6 bits. Expansion ratio is 8/5 = 1.6× vs Base64's 4/3 ≈ 1.33×.