DevToolsmith

Base32 Encode / Decode

Encode text to Base32, or decode Base32 back to text, as you type. Supports the standard RFC 4648 alphabet, base32hex and Crockford’s Base32, with or without = padding. Binary results are shown as hex. Everything runs in your browser.

Runs 100% in your browser — nothing is uploaded

Input
Tip: drop a file here16 chars · 18 bytes · 1 line
Output
32 chars · 32 bytes · 1 line

Base32 alphabets

foobar in each alphabet:

AlphabetEncodedUsed for
RFC 4648 (standard) MZXW6YTBOI====== TOTP secrets (Google Authenticator), Tor .onion addresses, file names on case-insensitive systems
base32hex (RFC 4648 §7) CPNMUOJ1E8====== Keeps sort order of the encoded data: NSEC3 hashes in DNSSEC
Crockford CSQPYRK1E8 Human-typed codes: ULIDs, order numbers; no padding, ignores hyphens, reads O as 0 and I/L as 1

Base32 in code

Python
import base64

base64.b32encode(b"foobar")            # b'MZXW6YTBOI======'
base64.b32decode("mzxw6ytboi", casefold=True)  # needs padding: add "=" * (-len(s) % 8)
base64.b32hexencode(b"foobar")         # b'CPNMUOJ1E8======' (Python 3.10+)
Shell (GNU coreutils)
echo -n foobar | base32        # MZXW6YTBOI======
echo MZXW6YTBOI====== | base32 -d
Go
import "encoding/base32"

base32.StdEncoding.EncodeToString([]byte("foobar"))          // MZXW6YTBOI======
base32.StdEncoding.WithPadding(base32.NoPadding).EncodeToString(b) // no "="
base32.HexEncoding.EncodeToString([]byte("foobar"))          // CPNMUOJ1E8======

Need the more compact Base64? Use Base64 encode and decode. Looking at the raw bytes? The hex converter shows them byte by byte.

Frequently asked questions

What is Base32 used for?

Anywhere data must survive being typed, read aloud or used in a case-insensitive context. The best-known example is the secret key behind authenticator apps (TOTP, RFC 6238), shown as a Base32 string like JBSWY3DPEHPK3PXP. It is also used in Tor .onion addresses, ULIDs (Crockford’s alphabet) and DNS, where names aren’t case-sensitive.

Base32 vs Base64: which should I use?

Base64 is more compact: it adds 33% to the size, while Base32 adds 60%. Use Base64 for data that only machines read, like attachments or tokens. Use Base32 when people will type or read the value, or when the alphabet must be case-insensitive and contain no + or /, which break URLs and file names.

Why does my Base32 string end in equals signs?

Base32 works in blocks of 5 bytes, written as 8 characters. When the input isn’t a multiple of 5 bytes, RFC 4648 pads the last block with = so the length is a multiple of 8. Many systems, including most TOTP apps, leave the padding out; the decoder accepts both. Untick “Padding” to produce unpadded output.

Is it case-sensitive?

No. The standard alphabet is uppercase A–Z and 2–7, but lowercase input decodes to the same bytes, and spaces and hyphens used to group characters are ignored.