Base32 Converter
Encode text to Base32 and decode Base32 strings back to text
Conversion Mode
Text Input
Base32 Output
Output will appear here
Base32 Alphabet
A
0
B
1
C
2
D
3
E
4
F
5
G
6
H
7
I
8
J
9
K
10
L
11
M
12
N
13
O
14
P
15
Q
16
R
17
S
18
T
19
U
20
V
21
W
22
X
23
Y
24
Z
25
2
26
3
27
4
28
5
29
6
30
7
31
About Base32
Base32 encoding converts binary data into a text format using 32 ASCII characters (A-Z and 2-7).
Each character represents 5 bits of data, making it less efficient than Base64 but more human-readable.
Base32 is commonly used in TOTP (Time-based One-Time Password) systems and file naming.
What Is Base32 Encoding?
Base32 encoding is a binary-to-text encoding scheme that represents arbitrary binary data using a alphabet of 32 printable ASCII characters. The standard Base32 alphabet uses uppercase letters A through Z and the digits 2 through 7, chosen for their clarity and resistance to misreadings. Each Base32 character encodes exactly 5 bits of data, making the encoding less space-efficient than Base64 (which uses 6 bits per character) but more readable and resistant to transcription errors.
Base32 was designed to solve a specific problem: encoding binary data in contexts that only reliably support uppercase letters and digits. Many legacy systems, file systems, and communication protocols were originally designed for alphanumeric text and could not safely handle characters like +, /, or = that appear in Base64. Base32 avoids these problematic characters entirely, using only the unambiguous subset of the ASCII character set.
The most prominent use of Base32 is in TOTP (Time-based One-Time Password) systems like Google Authenticator and Authy. When you scan a QR code to set up two-factor authentication, the secret key is typically encoded as a Base32 string. Base32 is also used in DNS for encoding certain data records, in file naming schemes where special characters must be avoided, and in various protocols that require alphanumeric-only encoding.
How Base32 Encoding Works
Base32 encoding converts binary data to text through a series of bit-grouping steps. The process groups input bits into 5-bit chunks and maps each chunk to a character in the Base32 alphabet.
Base32 Encoding Process
Where:
- Input= Original binary data (8-bit bytes)
- 5-bit chunks= Input bits regrouped into sets of 5
- Output= Base32 encoded string (= and padding added as needed)
The Base32 Alphabet
The Base32 alphabet consists of 32 characters, each representing a value from 0 to 31. The alphabet is carefully chosen to exclude visually ambiguous characters and those that might be problematic in various encoding contexts.
| Value | Character | Value | Character |
|---|---|---|---|
| 0-7 | A-H | 16-23 | Q-X |
| 8-15 | I-P | 24-31 | Y-Z, 2-7 |
The characters 0, 1, 8, and 9 are deliberately excluded because they are frequently confused with O, l, B, and g respectively. The equals sign (=) is used as padding when the encoded data is not a multiple of 5 bytes, similar to how Base64 uses padding.
How to Use This Calculator
The Base32 converter supports both encoding (text to Base32) and decoding (Base32 to text):
- Choose the conversion mode: Click "Text → Base32" to encode text, or "Base32 → Text" to decode a Base32 string.
- Enter the input: Type or paste your text (for encoding) or Base32 string (for decoding) into the input area.
- View the result: The converted output appears instantly in the result panel. Invalid input is flagged with an error message.
The Base32 alphabet reference chart is displayed below the converter, showing the mapping between each character and its numeric value.
Real-World Applications
Base32 is most widely known for its role in two-factor authentication (2FA). When you scan a QR code to set up Google Authenticator, Microsoft Authenticator, or similar apps, the shared secret is encoded as a Base32 string. This encoding ensures the secret can be reliably transmitted through QR codes and manual entry without ambiguity.
In DNS and networking, Base32 encoding is used in various record types and protocols. The DNSSEC specification uses Base32 to encode certain data fields, and some proprietary APIs use Base32 for encoding binary tokens in URLs or headers.
File naming and storage applications sometimes use Base32 when file names must contain only alphanumeric characters. For example, some email systems encode binary content identifiers using Base32 to ensure they remain valid across different file systems and operating systems that may have restrictions on special characters in file names.
Worked Examples
Encoding Text to Base32
Problem:
Encode the word 'Hello' to Base32.
Solution Steps:
- 1Convert each character to its ASCII binary: H=01001000, e=01100101, l=01101100, l=01101100, o=01101111
- 2Concatenate all bits: 0100100001100101011011000110110001101111
- 3Group into 5-bit chunks: 01001 00001 10010 10110 11000 11011 00011 01111
- 4Map each chunk to the Base32 alphabet: JBSW Y3DP E3I6
- 5Add padding to make output a multiple of 8 characters: JBSWY3DP
Result:
'Hello' encoded in Base32 = JBSWY3DP
Decoding Base32 to Text
Problem:
Decode the Base32 string 'JBSWY3DP' back to text.
Solution Steps:
- 1Remove any padding characters (=): JBSWY3DP
- 2Map each character to its 5-bit value: J=9, B=1, S=18, W=22, Y=24, 3=27, D=3, P=15
- 3Convert to binary: 01001 00001 10010 10110 11000 11011 00011 01111
- 4Regroup into 8-bit bytes: 01001000 01100101 01101100 01101100 01101111
- 5Convert bytes to ASCII: H, e, l, l, o
Result:
JBSWY3DP decoded = 'Hello'
Comparing Base32 and Base64 Efficiency
Problem:
How many characters does it take to encode the 16-byte string 'abcdefghijklmnop' in Base32 versus Base64?
Solution Steps:
- 116 bytes = 128 bits
- 2Base32: 128 bits / 5 bits per character = 25.6, rounded up to 32 characters (with padding)
- 3Base64: 128 bits / 6 bits per character = 21.33, rounded up to 24 characters
- 4Base32 produces 32 characters vs Base64's 24, confirming Base64 is more space-efficient
Result:
Base32 uses 32 characters, Base64 uses 24 characters for the same data — Base64 is 33% more efficient
Tips & Best Practices
- ✓Base32 is ideal for encoding 2FA secrets — it's the standard format used by authenticator apps
- ✓Output length is always a multiple of 8 characters (padded with = if needed)
- ✓Base32 strings are case-insensitive — 'JBSWY3DP' and 'jbswy3dp' decode to the same value
- ✓The excluded characters (0, 1, 8, 9) prevent confusion between similar-looking glyphs
- ✓Base32 is less efficient than Base64 but safer for human transcription and QR codes
- ✓Use Base32 when you need alphanumeric-only encoding without special characters
Frequently Asked Questions
Sources & References
Last updated: 2026-06-06
Help us improve!
How would you rate the Base32 Converter?
Editorial Note
MyCalcBuddy Editorial Team
This page is maintained as an educational calculator reference.
Formula Source: NIST Guide to SI Units
by National Institute of Standards