๐Ÿ”ก Base32 Converter

Output
JBSWY3DPFQQFO33SNRSCC===

Encode text into Base32 (as defined by RFC 4648), or decode a Base32 string back into text. Base32 is commonly used for data that needs to be represented using only letters and digits, such as TOTP (two-factor authentication) secret keys.

How to use

  1. Choose the "Encode" or "Decode" tab.
  2. Enter text to encode, or a Base32 string to decode.
  3. The result appears automatically โ€” use the copy button to copy it to your clipboard.

How the calculation works

Base32, defined in RFC 4648, represents data using only 32 characters: the capital letters Aโ€“Z and the digits 2โ€“7. It works well in case-insensitive systems and when people read out or type the value, and is used for things like two-factor authentication (TOTP) secrets. The data is split into 5-bit chunks, and each chunk becomes one of the 32 characters. Five bytes (40 bits) make exactly 8 characters, so the output is padded with "=" to a multiple of 8. This tool encodes text as UTF-8 first. When decoding, it also accepts lower case and input without the trailing "=".

Worked example

Test vectors from RFC 4648 "f" โ†’ MY====== "fo" โ†’ MZXQ==== "foo" โ†’ MZXW6=== "foob" โ†’ MZXW6YQ= "fooba" โ†’ MZXW6YTB "foobar" โ†’ MZXW6YTBOI====== "Hello, World!" โ†’ JBSWY3DPFQQFO33SNRSCC===

Things to be aware of

  • Base32 output is about 25% longer than Base64 (Base64 is about 1.33 times the input, Base32 about 1.6 times).
  • The digits 0, 1 and 8 are left out so they are not confused with the letters O, I and B.
  • Base32 is not encryption; anyone can decode it.

FAQ

What's the difference between Base32 and Base64?

Base64 uses 64 characters (A-Z, a-z, 0-9, +, /), while Base32 uses only 32 characters (A-Z, 2-7). Base32 is often preferred for case-insensitive contexts or data meant to be typed by hand, such as two-factor authentication secret keys.

What alphabet does this use?

The standard RFC 4648 alphabet: the 32 characters A-Z and 2-7, with "=" used for padding.

Why does decoding sometimes fail?

If the input contains characters outside the Base32 alphabet (like 0, 1, 8, or 9), it's treated as invalid input.