User Rating 0.0 β˜…β˜…β˜…β˜…β˜…
Total Usage 0 times
Accepts A–Z, 2–7, and = padding. Whitespace is ignored.
Output Format
Is this tool helpful?

Your feedback helps us improve.

β˜… β˜… β˜… β˜… β˜…

About

Base32 encoding represents binary data using a 32-character alphabet (A - Z and 2 - 7) defined in RFC 4648. Each character encodes 5 bits, so 8 encoded characters produce 5 bytes of output. Incorrect decoding - wrong alphabet, ignored padding, or mishandled bit alignment - silently corrupts data. This is particularly dangerous for TOTP secret keys, Onion service addresses, and binary file hashes where a single flipped bit invalidates the entire payload. This tool implements the full RFC 4648 specification including strict padding validation and provides both UTF-8 text and hexadecimal output so you can verify byte-level accuracy.

Note: this decoder assumes standard Base32 (RFC 4648 Β§6). It does not handle Base32hex (Extended Hex Alphabet) or Crockford’s Base32. Input containing characters outside the valid alphabet is rejected. Whitespace and line breaks are stripped automatically before decoding.

base32 decode RFC 4648 encoding binary converter

Formulas

Base32 decoding maps each character to a 5-bit integer, concatenates all bits into a single binary stream, then extracts 8-bit bytes. The core relationship between encoded length and decoded byte count is:

nbytes = nchars Γ— 58

Where nchars is the count of non-padding characters. Padding determines how many trailing bytes to discard from the final group:

{
0 padding β†’ 5 bytes1 padding β†’ 4 bytes3 padding β†’ 3 bytes4 padding β†’ 2 bytes6 padding β†’ 1 byte

The algorithm accumulates bits in a buffer b with a bit count k. For each character c: b = (b << 5) | lookup(c), then k = k + 5. Whenever k β‰₯ 8, extract the top byte: byte = (b >> (k βˆ’ 8)) & 0xFF, then k = k βˆ’ 8.

Valid padding counts per RFC 4648 are 0, 1, 3, 4, or 6. Counts of 2, 5, 7 are illegal and indicate corrupted input.

Reference Data

Base32 CharacterDecimal ValueBinary (5-bit)
A000000
B100001
C200010
D300011
E400100
F500101
G600110
H700111
I801000
J901001
K1001010
L1101011
M1201100
N1301101
O1401110
P1501111
Q1610000
R1710001
S1810010
T1910011
U2010100
V2110101
W2210110
X2310111
Y2411000
Z2511001
22611010
32711011
42811100
52911101
63011110
73111111
=Padding (fills incomplete 8-character groups)

Frequently Asked Questions

TOTP secrets (RFC 6238) are Base32-encoded without padding in many implementations (e.g., Google Authenticator). This decoder strips whitespace and handles missing padding by computing the required pad characters from the input length modulo 8. If your secret contains lowercase letters, they are automatically uppercased. If it still fails, the secret may use a non-standard alphabet.
Per RFC 4648, only 0, 1, 3, 4, or 6 padding characters are valid in an 8-character group. A count of 2, 5, or 7 means the input length (excluding padding) does not map to a whole number of bytes. This decoder rejects such input.
Base32 uses 5 bits per character (32 symbols: A - Z, 2 - 7), while Base64 uses 6 bits per character (64 symbols including + and /). Base32 output is roughly 20% longer than Base64, but avoids case sensitivity issues and ambiguous characters (0 vs O, 1 vs l). This makes Base32 preferred for manual transcription (e.g., backup codes).
Yes. Switch the output mode to Hex to see the raw byte values. The UTF-8 text output uses the TextDecoder API with the fatal flag disabled, so invalid byte sequences are replaced with the Unicode replacement character U+FFFD. For binary payloads, always verify against the hex output.
The decoder processes up to 10 MB of Base32 text, which decodes to approximately 6.25 MB of binary data. This covers virtually all practical use cases including encoded certificate bundles and firmware blobs. Processing is synchronous but completes in under 200 ms for typical inputs.
No. This tool strictly implements RFC 4648 Section 6 (standard Base32 with alphabet A - Z, 2 - 7). Base32hex (Section 7) uses 0 - 9, A - V and preserves sort order. Feeding Base32hex input into this decoder will produce incorrect results.