How to use the Base32 Encoder / Decoder
- 1
Choose encode or decode
Encode turns bytes into Base32; decode turns Base32 back into bytes.
- 2
Pick the alphabet
RFC 4648 standard, Base32hex or Crockford. Use the same one for encoding and decoding.
- 3
Say what the bytes are
UTF-8 text for normal strings; Hex for raw binary such as keys or hashes.
- 4
Set padding and case
Turn = padding on or off and choose lowercase output if a system expects it.
Features
Three alphabets
A–Z2–7, 0–9A–V and Crockford’s 0–9 plus letters without I, L, O, U.
Full Unicode
Text is encoded as UTF-8, so emoji and Indian scripts round-trip correctly.
Hex mode
Encode raw bytes from hex, or decode Base32 to hex when the result is binary.
Forgiving decoder
Ignores case, spaces, hyphens and = padding.
Crockford aliases
When decoding Crockford, O is read as 0 and I or L as 1.
Local
Runs in the browser; your last input is remembered only in this browser.
Who uses it — and for what
2FA secrets
Inspect or convert TOTP secrets for your own test accounts.
Identifiers
Make case-insensitive IDs for URLs, file names or DNS labels.
Developers
Check that a library’s Base32 output matches the standard.
Learners
See how bits are regrouped from 8 to 5.
What is Base32?
Base32 turns any bytes into text using 32 characters — by default the letters A–Z and digits 2–7. It is about 20% longer than Base64 but has big practical advantages: it is case-insensitive, avoids look-alike characters such as 0/O and 1/l, and contains no symbols that need escaping in URLs or file names. That is why it is used for two-factor authentication secrets (the codes you type into Google Authenticator), onion addresses, DNS-safe identifiers, ULIDs and some file-sharing links.
Alphabets
- RFC 4648 standard — A–Z then 2–7, padded with
=to a multiple of 8 characters. Used by TOTP secrets. - Base32hex — 0–9 then A–V, which keeps the sort order of the original data.
- Crockford — excludes I, L, O and U to avoid confusion and accidental words; decoding treats O as 0 and I/L as 1. Used by ULID.
Choose “Hex” to encode raw bytes, for example a key you have in hexadecimal. Decoding ignores spaces, hyphens and padding. Everything runs in your browser.
How the 8-to-5 bit regrouping works
Base32 reads the input as a stream of bits and cuts it into 5-bit groups, each of which picks one of 32 characters. Five bytes (40 bits) become exactly eight characters, which is why output is padded to a multiple of 8 with =. Take f (0x66 = 01100110): the first 5 bits 01100 are 12 → M; the remaining 3 bits 110 are padded with zeros to 11000 = 24 → Y; then six = signs complete the block: MY======.
| Input bytes in last block | Characters | Padding |
|---|---|---|
| 1 | 2 | 6 × = |
| 2 | 4 | 4 × = |
| 3 | 5 | 3 × = |
| 4 | 7 | 1 × = |
| 5 | 8 | none |
The result is 8/5 the size of the input (60% larger), compared with 4/3 (about 33% larger) for Base64.
Which alphabet for which job
- RFC 4648 standard (A–Z, 2–7): authenticator-app secrets in
otpauth://links, many file-sharing and onion-service identifiers. Digits 0 and 1 are left out to avoid confusion with O and I. - Base32hex (0–9, A–V): preserves the sort order of the underlying bytes, which is why DNSSEC NSEC3 records use it.
- Crockford: designed for humans — omits I, L, O and U and accepts common misreadings when decoding. ULIDs use it; see the ULID generator.
Mixing them up is the classic bug: Base32hex output fed to a standard decoder fails on digits 0, 1, 8 and 9, which are not in the standard alphabet. For example, decoding ABC1 with the standard alphabet stops with “1 is not a valid Base32 character”.
Base32 and two-factor secrets
Authenticator apps store a shared secret, usually shown as Base32 under a QR code (“can’t scan? enter this key”). Decoding it here in Hex mode shows the raw key bytes, which is useful when building or testing your own TOTP implementation. Treat real 2FA secrets like passwords: anyone holding one can generate your login codes. Use test accounts when experimenting, and remember the page keeps your last input in this browser’s local storage — press Clear when you are done. Base32 is an encoding, not encryption: it hides nothing.
Worked examples
The RFC 4648 test vectors
| Input | Standard | Base32hex | Crockford |
|---|---|---|---|
| f | MY====== | CO====== | CR |
| foo | MZXW6=== | CPNMU=== | CSQPY |
| foobar | MZXW6YTBOI====== | CPNMUOJ1E8====== | CSQPYRK1E8 |
The first two columns match the examples published in RFC 4648 section 10. Crockford output is never padded.
The sample text
Hello, Base32! 👋 is 19 bytes in UTF-8 (the emoji alone is 4) and encodes to the 32 characters JBSWY3DPFQQEEYLTMUZTEIJA6CPZDCY=.
Raw bytes from hex
With “Bytes are: Hex”, the 10 bytes 48656c6c6f21deadbeef encode to JBSWY3DPEHPK3PXP — no padding needed, because 10 bytes is exactly 80 bits, 16 characters of 5 bits. Decoding 74====== as text fails with a message to switch to Hex, because the single byte 0xFF is not valid UTF-8.
Pro tips
- Many systems accept unpadded Base32 — turn padding off for URLs and IDs.
- Group long secrets in blocks of four when reading them aloud; the decoder ignores the spaces.
- If decoded text shows an error, the data was probably binary — switch “Bytes are” to Hex.
Glossary
- Encoding
- A reversible way to represent data in a different set of characters.
- Padding
- Trailing = characters that bring the output to a whole 8-character block.
- UTF-8
- The standard way to turn text into bytes; one to four bytes per character.
- TOTP
- Time-based one-time password, the 6-digit codes in authenticator apps.
Frequently asked questions
Is Base32 encryption?
No — it is a reversible encoding that anyone can decode.
Why do 2FA secrets use Base32?
They are easy to read aloud and type, because Base32 is case-insensitive and avoids confusing characters.
Base32 or Base64?
Base64 is shorter; Base32 is safer for humans, URLs and case-insensitive systems.
Is lowercase Base32 valid?
Decoders here accept any case. RFC 4648 output is uppercase, but many systems also accept lowercase.
Why does Crockford output have no padding?
Crockford’s scheme does not use padding, so the tool switches it off for that alphabet automatically.
Can I decode Base64 here?
No — Base64 uses a different alphabet. Use a Base64 decoder for that.
Last updated 2026-11-28 · Built by Vinayak Agarwal · Part of Developer & Web (77 tools)