Developer ToolsA little help for every day

Search by name or task, such as JSON or percentage.

Developer Tools

Base32 Encoder and Decoder

Encode text, hex or Base64 to Base32, or decode Base32 to text, hex and Base64. Supports RFC 4648, Base32hex and Crockford alphabets, including TOTP secrets.

View all tools
ResultUpdates as you type
JBSWY3DPEB3W64TMMQ======

11 bytes → 24 characters.

How to use Base32 Encoder and Decoder

Paste text or Base32, choose Encode or Decode and pick the alphabet. When encoding you can start from UTF-8 text, hex bytes or Base64; decoding shows the bytes as text, hex and Base64 side by side.

  1. Paste the inputEnter text such as Hello world, or a Base32 string such as JBSWY3DP; spaces and hyphens are ignored when decoding.
  2. Choose action and alphabetSelect Encode or Decode and RFC 4648, Base32hex or Crockford; when encoding, set the input format too.
  3. Copy the resultUntick Add = padding if you do not want it, then copy the Base32 or the decoded text, hex or Base64.

Three Base32 alphabets

RFC 4648 standard Base32 uses A–Z and 2–7 and is what TOTP authenticator secrets use: Hello encodes to JBSWY3DP, and foobar to MZXW6YTBOI====== with padding. Base32hex uses 0–9 and A–V, so encoded strings sort in the same order as the original bytes; foobar becomes CPNMUOJ1E8======. Crockford's alphabet uses 0–9 and A–Z without I, L, O and U, never adds padding, and reads I and L as 1 and O as 0 when decoding; foobar becomes CSQPYRK1E8. The input for encoding can be UTF-8 text, hex bytes or Base64.

Decoding TOTP secrets and binary data

Secrets for Google Authenticator and similar apps are usually random bytes written in Base32, so they do not decode to readable text. The decoder shows hex and Base64 alongside, and when the result is 10, 16, 20, 32 or 64 bytes of non-text data it points out that this looks like a binary key: JBSW Y3DP EHPK 3PXP JBSW Y3DP EHPK 3PXP, for instance, is a 160-bit key. Case, spaces and hyphens are ignored. Invalid lengths, = signs before the end and characters outside the alphabet are reported, with a hint if 0, 1, 8 or 9 appear in standard Base32.

Accuracy and data handling

Validate the result with your project's own tests and runtime rules before using it in production. The calculation runs in your current browser; the tool code does not send the input to a processing API.

Often Used Together

Next step

FAQ

What is the difference between Base32 and Base64?

Base32 uses only capital letters and digits, so it is case-insensitive and easy to type or read aloud, but its output is about 20% longer than Base64 for the same data.

Why does my decoded Base32 look like gibberish?

The data is binary rather than text, as with a TOTP secret. Use the hex or Base64 value instead of the UTF-8 text line.

Do I need the = padding?

RFC 4648 pads to a multiple of 8 characters, but TOTP secrets usually leave it out. The decoder accepts both, and you can untick Add = padding when encoding.

More Developer Tools

Related tools