📋 Base32 Encoder & Decoder

Ad Slot - Top (728×90)

Input Text

Result

Results will appear here...
Ad Slot - Middle (728×90)

Base32 Encoding Guide

What is Base32?

Base32 is an encoding scheme that converts binary data into an ASCII string, defined by the RFC 4648 standard. It uses 32 characters (A-Z excluding I and O, plus digits 2-7) to encode every 5 bytes of data into 8 characters. Base32's character set is simple and case-insensitive, making it ideal for QR codes, OTP keys, DNS records, and similar applications.

Base32 vs Base64

Base32 uses 32 characters (A-Z excluding I and O + 2-7), while Base64 uses 64 characters (A-Z + a-z + 0-9 + +/). Base32 has lower encoding density (about 60% overhead) but a simpler character set that is case-insensitive, suitable for environments where case distinction is problematic. Base64 has higher encoding density (about 33% overhead) and is better for data transmission.

Common Use Cases

OTP One-Time Passwords: Google Authenticator, Microsoft Authenticator, and other 2FA apps use Base32-encoded keys

QR Code Encoding: QR codes have limited capacity, and Base32's case-insensitive nature makes it ideal

DNS TXT Records: Binary data in DNS TXT records is commonly encoded with Base32

URL Shorteners: URL shortening services use Base32 to generate short codes

How to Use

This Base32 encoder and decoder is simple to use and fully featured. Here's a detailed guide:

Encoding: Enter the text you want to encode in the input field (supports Chinese, Emoji, and all Unicode characters). The tool encodes the text into a Base32 string in real time. Character and byte count statistics appear below the input, helping you understand data size. The encoded result appears in the result area, and you can click "Copy" to copy it to your clipboard.

Decoding: Paste a Base32-encoded string into the input field, and the tool automatically detects and decodes it. If "Auto-detect & decode" is enabled, the tool decodes automatically when it detects a valid Base32 string. The decoded text appears in the result area and can be copied or further processed.

Swap Function: Use the "Swap" button to exchange input and output content, useful for chaining multiple encode/decode operations. The "Result to Input" button moves the result directly to the input field, saving you from manual copying.

Application Scenarios

Base32 encoding is widely used in security and data transmission. Here are some typical use cases:

Two-Factor Authentication (2FA) Keys: Apps like Google Authenticator and Microsoft Authenticator use Base32-encoded keys to generate Time-based One-Time Passwords (TOTP). When you set up 2FA, the app generates a Base32 string like JBSWY3DPEHPK3PXP, which is then encoded as a QR code for scanning. Understanding Base32 helps you grasp how 2FA works under the hood.

QR Code Data Encoding: QR codes have limited capacity (maximum about 2,953 bytes for version 40). Although Base32 doesn't save space, its case-insensitive nature makes it more error-tolerant when scanning and less prone to mistakes during manual transcription. Many QR code applications choose Base32 as their data encoding scheme.

DNS TXT Records: In DNS systems, TXT records are commonly used to pass verification information or configuration data. When binary data (such as DKIM public keys) needs to be transmitted, Base32 encoding is a common choice because DNS itself is case-insensitive, and Base32's character set fits this environment perfectly.

Extended Knowledge

Base32 Encoding Principle: Base32 splits every 5 bytes (40 bits) of data into 8 groups of 5 bits. Each 5-bit group corresponds to an index from 0 to 31, which is then mapped to a printable character via a fixed 32-character lookup table (A-Z excluding I and O + 2-7). If the original data is not a multiple of 5, 1 to 4 = padding characters are appended at the end.

Base32 vs Encryption: Base32 is encoding, not encryption. Encoded data can be decoded by anyone and provides no confidentiality. However, Base32 is often used alongside encryption systems—for example, 2FA keys are encrypted with AES or similar algorithms, and Base32 is merely used to present the key in a human-readable format.

Base32 Variants: Standard Base32 (RFC 4648) is the most widely used variant. There is also Base32Hex (using 0-9 + A-V, arranged by numeric order) and Crockford Base32 (removing ambiguous characters and adding check digits). This tool uses standard Base32 (RFC 4648).

What is the difference between Base32 and Base64?

Base32 uses 32 characters (A-Z excluding I and O, plus 2-7) while Base64 uses 64 characters. Base32 has a simpler character set, is case-insensitive, and works well with QR codes and short links. Base64 has higher encoding density and is better for data transmission.

Is Base32 encryption?

No. Base32 is an encoding scheme, not an encryption scheme. Anyone can decode Base32-encoded data, so it provides no security protection.

Does Base32 encoding increase data size?

Yes. Base32 encoding increases data size by approximately 60% (5 bytes become 8 characters). For example, 500 bytes of data encode to about 800 characters. This is higher than Base64's 33% overhead.

Does it support non-ASCII characters like Chinese?

Yes. The tool uses the TextEncoder API to convert text to UTF-8 bytes before encoding, fully supporting Chinese, Emoji, and other multi-byte characters.

What is the RFC 4648 standard for Base32?

RFC 4648 defines data encoding schemes for Base16, Base32, and Base64. Standard Base32 uses the character set A-Z (excluding I and O) and 2-7, totaling 32 characters, with = padding at the end.

What are common use cases for Base32?

Base32 is commonly used for OTP (One-Time Password) keys (e.g., Google Authenticator), QR code encoding, DNS TXT records, URL shorteners, and any scenario requiring case-insensitive data transmission.

Can Base32 encoding contain lowercase letters?

Standard Base32 only uses uppercase letters A-Z (excluding I and O) and digits 2-7. However, many decoders are case-insensitive and convert input to uppercase before processing. This tool accepts mixed-case input.

Ad Slot - Bottom (728×90)