Base32 to Text Converter
Convert Base32 encoded strings to plain text and vice versa. Supports RFC 4648, Crockford, z-base-32, and Base32Hex variants.
About
Base32 encoding represents binary data using a 32-character alphabet, producing output that is case-insensitive and safe for case-folding filesystems, DNS labels, and human verbal communication. RFC 4648 defines the canonical alphabet (A - Z, 2 - 7) with = padding. Each input byte (8 bits) maps to 85 output characters, yielding a 160% size expansion. Incorrect variant selection or stray characters cause silent data corruption. This tool validates the input alphabet, strips whitespace, and decodes the bitstream faithfully.
Four variants are supported. Crockford excludes I, L, O, U to avoid human misreading. z-base-32 reorders characters to place the most visually distinct glyphs at the highest-frequency bit patterns. Base32Hex preserves sort order by using 0 - 9 then A - V. Mixing alphabets between variants produces garbage output without any error signal from a naive decoder. This converter detects alphabet mismatches and warns before producing output.
Formulas
Base32 encoding maps every 5 bits of input to one character from a 32-symbol alphabet. Decoding reverses this: each character yields a 5-bit value, the bits are concatenated, and the resulting bitstream is split into 8-bit bytes.
The total output length is rounded up to the nearest multiple of 8 with = padding (in RFC 4648 and Base32Hex):
Decoding algorithm per character ci:
Then extract bytes:
Where nbytes is the number of input bytes, nchars is the number of Base32 characters (excluding padding), lookup maps a character to its 0 - 31 integer value using the selected variant's alphabet, and pad left-pads the binary string to 5 digits.
Reference Data
| Variant | Alphabet | Padding | Case Sensitive | Standard | Use Case |
|---|---|---|---|---|---|
| RFC 4648 (Standard) | A - Z, 2 - 7 | = | No | RFC 4648 ยง6 | SASL, XMPP, general encoding |
| Base32Hex | 0 - 9, A - V | = | No | RFC 4648 ยง7 | Sort-preserving encoding, NSEC3 |
| Crockford | 0 - 9, A - HJ - KM - NP - TV - W | None | No | Crockford spec | Human-readable IDs, check symbols |
| z-base-32 | ybndrfg8ejkmcpqxot1uwisza345h769 | None | Yes (lower) | z-base-32 spec | Mnet-URI, human-oriented hashes |
| Encoding Size Comparison (per input length) | |||||
| Input Bytes | Base32 Chars | Padding Chars | Total Output | Bit Waste | Expansion Ratio |
| 1 | 2 | 6 | 8 | 2 bits | 800% |
| 2 | 4 | 4 | 8 | 4 bits | 400% |
| 3 | 5 | 3 | 8 | 1 bit | 267% |
| 4 | 7 | 1 | 8 | 3 bits | 200% |
| 5 | 8 | 0 | 8 | 0 bits | 160% |
| Character Encoding Reference | |||||
| Value 0 | RFC: A | Hex: 0 | Crockford: 0 | z-base: y | |
| Value 9 | RFC: J | Hex: 9 | Crockford: 9 | z-base: e | |
| Value 15 | RFC: P | Hex: F | Crockford: F | z-base: x | |
| Value 25 | RFC: Z | Hex: P | Crockford: P | z-base: 3 | |
| Value 31 | RFC: 7 | Hex: V | Crockford: W | z-base: 9 | |