Menu

Base32 Encode & Decode

What is Base32?

Base32 is a binary-to-text encoding scheme that represents binary data using a 32-character set. The most common standard, RFC 4648, uses the uppercase letters A–Z and the digits 2–7. It's designed to be case-insensitive and avoid ambiguous characters (like 0, O, 1, I, L).

How It Works

Encoding: Groups the input binary data into 5-bit chunks. Each 5-bit chunk maps to one character in the Base32 alphabet (A-Z, 2-7). Padding (`=`) is added at the end if the input data length isn't a multiple of 5 bytes (40 bits).

Decoding: Converts each Base32 character back into its corresponding 5-bit value. These bits are reassembled into 8-bit bytes to reconstruct the original binary data. Padding characters are handled according to the standard.

  • Uses characters A-Z and 2-7 (RFC 4648 standard). Other variants exist (like Base32hex).
  • Case-insensitive during decoding.
  • Output is roughly 60% larger than the original binary data (8 bits become 8/5 * 8 = ~12.8 bits -> 2 Base32 chars).
  • Often used where case-insensitivity is required or where certain characters might be problematic (e.g., in DNS).
  • Uses `=` for padding at the end.

Use Cases

Base32 is less common than Base64 but useful in specific scenarios:

  • File Names & URLs: Can be used in systems where case-insensitivity is required or preferred.
  • DNS Records: Used in NSEC3 records for DNSSEC to obscure domain names.
  • Two-Factor Authentication (2FA): Often used for sharing the secret key (TOTP/HOTP keys) as it's easier to read and type than Base64.
  • Identifier Encoding: Encoding binary identifiers into a format that is easier for humans to handle than raw bytes or hex.

Why is Base32 Useful?

Its main advantages lie in its case-insensitivity and restricted character set.

  • Case-Insensitive: Ideal for systems where case does not matter or can be easily confused.
  • Readability: Avoids visually similar characters (0/O, 1/I/L), making manual transcription less error-prone.
  • Filesystem/URL Safe: The standard alphabet is generally safe for filenames and URLs.

How to Use This Tool

  1. Select either "Encode" or "Decode" mode.
  2. Enter the text (for encoding) or Base32 string (for decoding, using a-z, 2-7, and optional '=' padding) into the top input field.
  3. The result will appear automatically in the bottom output field.
  4. Use the swap button () to switch the input and output, automatically changing the mode.
  5. Click the copy icon () next to the output label to copy the result.
  6. Error messages will appear for invalid input (e.g., characters outside the Base32 alphabet, incorrect padding) or conversion issues.