Base64Hub

Base32 Decoder: RFC 4648 5-Bit Radix Workbench

Decode and serialize 5-bit binary byte streams across RFC 4648 Base32, Douglas Crockford Base32, and RFC 6238 TOTP Authenticator seed keys with zero client data transmission.

5-BIT RADIX (+60.00%)
12 B
JBSWY3DPEBLW64TMMQ======
RFC 4648 Base32: 5-Bit Sextet Grouping (8 Chars per 5 Bytes)
Input Bytes12 Bytes (96 Bits)
Base32 Output24 Characters
Padding Equal ('=')6 Pad Bytes
Expansion Ratio1.600x (+60%)
5-Bit Bitplane Alignment Across 40-Bit Quanta (5 Bytes = 8 Chars) RFC 4648 §6 / Crockford / RFC 6238 TOTP
Quantum[0..4] = [0x48, 0x65, 0x6C, 0x6C, 0x6F] -> 40 Bits: 01001000 01100101 01101100 01101100 01101111
Sextets (5-bit): [01001=9('J'), 00001=1('B'), 10010=18('S'), 10101=21('W'), 10110=22('Y'), 01101=13('3'), 10001=17('D'), 01111=15('P')] -> "JBSWY3DP"
Precision digital logic analyzer workstation displaying 5-bit binary register grouping converting into RFC 4648 Base32 characters
5-bit sextet alignment across 40-bit quanta (5 input bytes = 8 Base32 characters) at +60.00% wire expansion.
RFC 4648 §6 & Crockford Normative Summary

Base32 partitions binary octets into 5-bit indices (25 = 32 glyphs). By omitting ambiguous glyphs like 0, 1, 8, and 9 in standard RFC 4648, Base32 provides high transcription fault tolerance for two-factor authentication (2FA) and DNSSEC NSEC3 records.

Base32 (+60.00%) vs. Base64 (+33.33%) vs. Hex (+100.0%) Overhead

Wire footprint comparison across binary payload scaling

RFC 4648 Base32 (1.600x) RFC 4648 Base64 (1.333x)
56 B 28 B 0 B 0.25x Raw 14 B Payload (20 B B64) 2.0x Scale
RFC 4648 Information Density Ratio (Raw / Base64 Wire Size) 75.0% Payload Efficiency (+33.3% Overhead)
40-Bit Input Quantum to 8-Character Sextet Decomposition
Q40 = ∑i=04 Bi2564-i = ∑j=07 Cj327-j

How Does Base32 Convert 40-Bit Binary Blocks Into Eight Characters Under RFC 4648?

Base32 groups every contiguous 5-byte sequence into a 40-bit block and partitions it into eight 5-bit indices (values 0 through 31). Mapping five ASCII bytes ("Hello") emits eight Base32 characters ("JBSWY3DP"), expanding wire footprint by exactly 60% while eliminating transcription ambiguity.

Unlike the 6-bit grouping used in our Data:Image/PNG;Base64 & Base64URL Converter and the 4-to-5 byte modulo arithmetic in our Base85 & Adobe Ascii85 Workbench, Base32 intentionally trades wire density for human legibility. Because 32 is an exact power of two (25), encoding and decoding execute via zero-cost bitwise shift operations in browser V8 memory.

When validating raw 160-bit SHA-1 or 256-bit SHA-256 HMAC keys, developers cross-reference binary digests in our NIST FIPS 180-4 SHA256 Checksum Workbench or examine byte-level endianness in our Hexadecimal & IEEE 754 Register Decoder.


Formal Mathematical Proof & Byte Boundary Audit

Mathematical Specifications, Native MathML Models & Verification Vectors

Formal IETF RFC 4648, IEEE Radix-16, ITU-R M.1677-1, and NIST FIPS 180-4 equations governing the client-side engine.

RFC 4648 §4 Base64 24-Bit Quantum Expansion

Verified Standard
LB64=4×⌈n3⌉andPpad=(3−(nmod3))mod3

Every 3-octet (24-bit) input group subdivides into four 6-bit indices (0..63). Remainder octets require 1 or 2 padding (0x3D) characters to align the 4-character quantum.

n (Input UTF-8 Bytes)
14

Byte length emitted by UTF-8 TextEncoder.encode(str)

L_B64 (Encoded Wire Size)
20

4-byte aligned ASCII output length (+33.33% ceiling)

RFC 4648 §8 Base16 Hexadecimal Positional Radix

Verified Standard
V10=∑i=0k−1di⋅16iwhereLHex=2n

Splits each 8-bit octet into high (b >> 4) and low (b & 0x0F) 4-bit nibbles mapped onto 0–9 and A–F, doubling character length (+100%).

L_Hex (Hex Nibble Length)
28

Two hexadecimal nibbles per raw input byte

0xFF (Max Octet Value)
255 Dec

Binary 11111111 full 8-bit unsigned integer ceiling

ITU-R M.1677-1 International Morse Signal Timing

Verified Standard
Tdah=3⋅Tdit,Tchar=3⋅Tdit,Tword=7⋅Tdit

Standardizes telegraph pulse durations relative to the fundamental dot quantum T_dit (1200 / WPM milliseconds under PARIS 50-unit calibration).

T_dit (Dot Unit)
1 Unit

Base pulse duration and intra-character element gap

T_word (Word Delimiter)
7 Units

Represented by "/" between space-delimited character codes

NIST FIPS 180-4 SHA-256 Compression Functions

Verified Standard
Ch(e,f,g)=(e∧f)⊕(¬e∧g),Maj(a,b,c)=(a∧b)⊕(a∧c)⊕(b∧c)

Processes 512-bit padded blocks across 64 Merkle-Damgård rounds over eight 32-bit state registers (H0..H7) to emit a 256-bit (64-hex-char) digest.

H_0..H_7 (Digest State)
256 Bits

Fractional square roots of the first 8 primes (2..19)

K_0..K_63 (Round Constants)
64 Words

Fractional cube roots of the first 64 primes (2..311)

Empirical Specification Verification Matrix

Vector Profile Input Stream Deterministic Output Byte Boundary Implication
UTF-8 Greeting Vector Plaintext: "Hello, Base64!" (14 B) SGVsbG8sIEJhc2U2NCE (1-pad, 20 B) 5-quantum ceiling with single 0x3D padding character (n mod 3 is 2).
High-Bit Octet Sequence Bytes: [251, 255, 191] (0xFBFFBF) Std: +/+/ | URL: -_-_ RFC 4648 §5 replaces "+" and "/" to prevent URL query corruption.
Hexadecimal Byte Stream Hex: "48 65 78" & "0xFF" ASCII: "Hex" | Dec: 255 (11111111) Case-insensitive radix-16 nibble parsing without NaN truncation.
ITU-R Distress Signal Plaintext: "SOS" (3 Chars) ... --- ... (27 Timing Units) 3 dits + 3-unit gap + 3 dahs + 3-unit gap + 3 dits.
NIST FIPS 180-4 Vector Input: "abc" (24 Bits) ba7816bf8f01cfea...f20015ad (64 Hex) Single 512-bit block compression yielding deterministic 256-bit digest.

1. RFC 4648 Section 6 Standard Alphabet (A–Z, 2–7)

The standard alphabet assigns indices 0–25 to uppercase letters A through Z and indices 26–31 to digits 2 through 7. Omission of 0, 1, 8, and 9 prevents confusion with letters O and I.

2. Douglas Crockford Base32 Human-Oriented Codec

Crockford Base32 permits case-insensitive input, normalizes I and L to 1, maps O to 0, and excludes U to eliminate accidental obscenities in generated user codes and product serial numbers.

3. RFC 6238 TOTP 2FA Shared Secret Keys

Time-based One-Time Password (TOTP) implementations in Google Authenticator, Bitwarden, and 1Password store 160-bit HMAC secret seeds as 32-character or 16-character Base32 strings (e.g., JBSWY3DPEHPK3PXP).

4. RFC 4648 Section 7 Base32Hex Lexicographical Sorting

Base32Hex replaces letters A–Z with 0–9 and A–V. Because digit ASCII codes precede letters, Base32Hex strings preserve binary collation order in database primary keys and DNSSEC records.

How Do RFC 4648 Base32, Crockford Base32, and Base32Hex Specifications Compare?

Evaluate alphabet glyphs, padding rules, transcription error tolerances, and primary cryptographic applications across all major Base32 standards.

Standard Alphabet Set Bit Quantum Expansion Padding Char Primary Application
RFC 4648 §6 Base32 A–Z, 2–7 5 Bits (5B → 8C) +60.00% = (1 to 6) RFC 6238 TOTP, Tor .onion v3 addresses
Crockford Base32 0–9, A–Z (no I, L, O, U) 5 Bits (5B → 8C) +60.00% None / Optional Check Customer codes, serial numbers, ULID identifiers
RFC 4648 §7 Base32Hex 0–9, A–V 5 Bits (5B → 8C) +60.00% = (1 to 6) DNSSEC NSEC3 hash representation, sorted keys
RFC 4648 §4 Base64 A–Z, a–z, 0–9, +, / 6 Bits (3B → 4C) +33.33% = (1 to 2) MIME email, Data URIs, TLS PEM certificates

Frequently Asked Questions: Base32, Crockford & TOTP Cryptographic Encoding

Why does RFC 4648 Section 6 Base32 encoding cause a 60.00% wire expansion compared to 33.33% in Base64? +

IETF RFC 4648 Section 6 Base32 maps binary byte streams into 5-bit chunks (2^5 = 32 values). The least common multiple between 8-bit octets and 5-bit indices is 40 bits (5 bytes). Every 5 bytes of binary input expand into 8 Base32 characters (8 / 5 = 1.600x, or +60.00% wire overhead). By contrast, Base64 packs 6 bits per character (4 characters per 3 bytes), yielding +33.33% overhead.

Why do Google Authenticator and RFC 6238 TOTP two-factor authentication use Base32 for shared secret keys? +

Base32 uses only uppercase letters A–Z and digits 2–7, entirely omitting digits 0, 1, 8, and 9 to eliminate optical confusion with vowels 'O' and 'I' during manual transcription. RFC 6238 TOTP and RFC 4226 HOTP standards mandate Base32 so users can reliably type 16-character and 32-character security codes into mobile authenticator apps without transcription failure.

How does Douglas Crockford's Base32 specification handle ambiguous letters 'I', 'L', 'O', and 'U'? +

Douglas Crockford designed his Base32 variant for human readability by treating uppercase and lowercase identically, decoding 'I' and 'L' as digit '1', mapping 'O' as digit '0', and completely banning 'U' to prevent accidental profanity in auto-generated customer service codes. Crockford's alphabet orders digits first (0–9) followed by 22 uppercase letters (A–Z excluding I, L, O, U).

How does Base32Hex (RFC 4648 Section 7) preserve natural sorting order compared to standard Base32? +

Standard RFC 4648 Base32 begins with letters 'A' (value 0) through 'Z' (value 25) before using digits '2' (value 26) through '7' (value 31), which inverts ASCII collating sequence. RFC 4648 Section 7 Base32Hex aligns with hexadecimal by mapping 0–9 to '0'–'9' and 10–31 to 'A'–'V', ensuring encoded strings sort identically to their underlying raw binary representations in database indexes.

What padding characters are appended to Base32 encoded strings when the input is not a multiple of 5 bytes? +

Under RFC 4648 Section 6, partial input quanta require equal sign ('=') padding: a 1-byte input yields 2 characters plus 6 '=' pads; 2 bytes yield 4 characters plus 4 '=' pads; 3 bytes yield 5 characters plus 3 '=' pads; and 4 bytes yield 7 characters plus 1 '=' pad, ensuring every complete block totals 8 output characters.

RFC 4648 Multi-Radix Protocol Inspector

Filename & URI Safe Base64URL Alphabet (Indices 62 & 63)

Replaces standard Base64 index 62 (+) with hyphen-minus (-, 0x2D) and index 63 (/) with underscore (_, 0x5F) while omitting trailing = (0x3D) padding characters for OAuth 2.0 PKCE and JWT headers.

Quantum Block
24-Bit (3 Octets -> 4 Sextets)
Index 62 / 63
- (0x2D) / _ (0x5F)
Canonical Vector
[251,255,191] -> -_-_
Encoding SchemeNormative RFCInput -> Output QuantumWire ExpansionPadding & URL Safety
Base64 Standard IETF RFC 4648 §4 3 Bytes (24b) -> 4 Sextets +33.33% (4/3n) Mandatory = (0x3D); unsafe + and / in URIs
Base64URL (Filename Safe) IETF RFC 4648 §5 3 Bytes (24b) -> 4 Sextets +33.33% (4/3n) Optional = omitted; uses - (0x2D) and _ (0x5F)
Base32 Uppercase IETF RFC 4648 §6 5 Bytes (40b) -> 8 Quintets +60.00% (8/5n) Uses A–Z and 2–7; case-insensitive DNS/TOTP safe
Base16 Hexadecimal IETF RFC 4648 §8 1 Byte (8b) -> 2 Nibbles +100.00% (2n) Zero padding; deterministic 0x00–0xFF nibble pairs
Percent-Encoding IETF RFC 3986 §2.1 1 Reserved Byte -> %XX Variable (1x–3x) Escapes reserved URI delimiters via % hex triplets