Logo

MonoCalc

/

URL Safe Base32 Encoder

Encode/Decode

Include = padding

Alphabet Reference — RFC 4648 Standard (A–Z, 2–7)

0:A 1:B 2:C 3:D 4:E 5:F 6:G 7:H 8:I 9:J 10:K 11:L 12:M 13:N 14:O 15:P 16:Q 17:R 18:S 19:T 20:U 21:V 22:W 23:X 24:Y 25:Z 26:2 27:3 28:4 29:5 30:6 31:7

About This Tool

🔐 URL Safe Base32 Encoder – Encode & Decode Online

Base32 encoding converts arbitrary binary data or plain text into a string using only 32 printable characters — making the output safe for URLs, file names, DNS labels, and case-insensitive environments without any percent-encoding. This tool supports real-time encoding and decoding across four popular Base32 alphabet variants, with full control over padding, line wrapping, and chunk formatting for token-style output.

🔤 Why Base32 Instead of Base64?

Base64 is the most compact text encoding (~33% overhead), but its alphabet includes +, /, and = — characters that have special meaning in URLs and shell environments. Base32 avoids all special characters and is fully case-insensitive, making it ideal for:

  • TOTP / 2FA secret keys — RFC 4648 Base32 is the standard encoding for Google Authenticator, Authy, and other TOTP implementations.
  • URL tokens & path segments — No reserved characters means no percent-encoding is ever needed.
  • DNS labels & subdomains — DNS is case-insensitive and restricted to alphanumeric characters, making Base32 a natural fit.
  • QR code payloads — Base32 takes advantage of QR code's alphanumeric mode (more compact than byte mode for uppercase-only data).
  • Human-readable tokens — Crockford Base32 strips confusing characters (I, L, O, U) to reduce transcription errors.

📐 Supported Alphabet Variants

VariantAlphabet (32 chars)Best For
RFC 4648A–Z, 2–7TOTP secrets, general purpose (the default)
Base32hex0–9, A–VLexicographic sort order preserved (DNS, databases)
Crockford0–9, A–Z (excl. I, L, O, U)Human-readable IDs, serial numbers, voucher codes
z-base-32Lowercase, human-optimisedFingerprints, hashes typed by hand

⚙️ How Base32 Encoding Works

Base32 operates on 5-byte (40-bit) blocks:

  1. Convert input text to a Uint8Array of UTF-8 bytes.
  2. Group bytes in blocks of 5 (40 bits total per block).
  3. Split each 40-bit block into eight 5-bit values (0–31).
  4. Map each 5-bit value to the corresponding character in the selected alphabet.
  5. Append = padding characters to make the output length a multiple of 8 (RFC 4648 and Base32hex only).
Input:  "Hello"  →  72 65 6C 6C 6F  (hex bytes)
Binary: 01110010 01100101 01101100 01101100 01101111
5-bit:  01110  01001  10010  10110  11000  11011  00011  01111
Index:  14     9      18     22     24     27     3      15
RFC4648: O      J      S      W      Y      3      D      P
Output: JBSWY3DP (no padding needed for 5-byte input)

📊 Encoding Size Overhead

Base32 expands data by approximately 60% (8 Base32 chars per 5 input bytes = 1.6× expansion). With = padding, the output is always a multiple of 8 characters.

5 bytes

→ 8 Base32 chars

~1.6×

size expansion

5 bits

per character

🔑 TOTP Secret Keys & Chunk Formatting

TOTP (Time-based One-Time Passwords, RFC 6238) uses RFC 4648 Base32 to encode secret keys. Authenticator apps like Google Authenticator, Authy, and Microsoft Authenticator expect keys in this format. For human-friendly display (e.g., in setup wizards), the key is often chunked into 4- or 8-character groups separated by hyphens: JBSWY3DP-FQQFO33S-NRSCC===.

Use the Chunk Size option in this tool to automatically format encoded output into TOTP-style tokens. Padding is typically stripped from TOTP keys since authenticator apps don't require it.

🔄 Decoding Base32

The decoder accepts Base32 strings in any supported alphabet and recovers the original UTF-8 text. The decoder automatically strips whitespace, hyphens, underscores, and = padding before processing. Invalid characters for the selected alphabet are flagged with a helpful error message identifying the exact character.

Frequently Asked Questions

Is the URL Safe Base32 Encoder free?

Yes, URL Safe Base32 Encoder is totally free :)

Can I use the URL Safe Base32 Encoder offline?

Yes, you can install the webapp as PWA.

Is it safe to use URL Safe Base32 Encoder?

Yes, any data related to URL Safe Base32 Encoder only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.

What is URL Safe Base32 encoding?

URL Safe Base32 encoding converts binary data or text into a string using only the characters A–Z and 2–7 (RFC 4648 Standard). Since these characters have no special meaning in URLs, file names, or DNS labels, the encoded output requires no percent-encoding and is safe for use anywhere.

How does this encoder/decoder work?

The encoder groups input bytes into 5-byte (40-bit) blocks, splits each block into eight 5-bit values, and maps each value to the chosen Base32 alphabet character. Decoding reverses this process. Select your alphabet variant, paste your input, choose encoding options, and the result appears instantly.

What alphabet variants are supported?

Four variants are supported: RFC 4648 Standard (A–Z, 2–7), Base32hex / Extended Hex (0–9, A–V), Crockford Base32 (avoids ambiguous characters I, L, O, U), and z-base-32 (a human-oriented lowercase alphabet). Each is suited for different use cases such as TOTP secrets, DNS labels, or human-readable tokens.

Why does Base32 output have '=' padding characters?

Since Base32 encodes 5 bytes at a time but your input may not be an exact multiple of 5 bytes, padding '=' characters are appended to make the total output length a multiple of 8 characters. You can strip padding when the consuming application doesn't require it, such as in TOTP secret keys.

When would I use chunked output?

Chunk mode splits the encoded output into fixed-length segments separated by a delimiter (e.g., a hyphen). This is common for TOTP/2FA secret keys (e.g., AAAAAAAA-BBBBBBBB) which improves readability and reduces manual transcription errors.

How does Base32 compare to Base64?

Base32 uses a 32-character alphabet (vs Base64's 64 characters), so it is case-insensitive and avoids characters that look similar (0/O, 1/I/l) when using Crockford variant. The trade-off is a larger encoded size (~1.6× expansion vs ~1.33× for Base64), but Base32 is better suited for case-insensitive contexts like DNS, file systems, and QR codes.