Skip to content
Sealpaste

Delete all recent work?

This removes the 0 items saved in this browser. Your settings stay.

Stop saving recent work?

New work won't be saved in this browser. The 0 items already saved can stay or go.

Base32 Encode & Decode

Text

Paste text, or

CtrlV paste · Ctrl↵ run now

Base32
Ready
Ln 1, Col 1
Runs in your browser. Nothing you paste is uploaded unless you share it.

Encode text or a file to Base32 or decode it: standard, Hex, Crockford or z-base-32

Convert text or any file to Base32 and back, in RFC 4648’s two alphabets, Crockford’s or z-base-32. Decoding takes lower case, spaces, hyphens and missing padding, the way authenticator apps show a secret; bytes that aren’t text show in hex.

How to use it

  1. Choose Encode or Decode, and the alphabet: A–Z 2–7 (the standard one), Hex, Crockford or z-base-32. To encode without the = at the end, turn Padding off.
  2. Paste your text or Base32, or open a file: to encode, any file works, an image or a key as well as text. Spaces, hyphens, line breaks and lower case are fine when decoding.
  3. Copy the result. Decoded bytes that aren’t text show in hex when short, and Download saves them as a file; Show as writes them in hex, decimal, binary or Base64 instead.

Examples

Encode text

Input
Hello, world!
Result
JBSWY3DPFQQHO33SNRSCC===

Every 5 bytes become 8 characters; = fills the last group.

Decode a TOTP secret

Input
JBSW Y3DP EHPK 3PXP
Result
Binary data, 10 bytes (application/octet-stream).
Download saves it as decoded.bin.

Hex: 48 65 6c 6c 6f 21 de ad be ef

A secret is random bytes, not text, so it shows in hex.

Decode Crockford Base32 with look-alike letters

Input
91jp-rv3f-41vp-ywkc-cggg
Result
Hello world!

Crockford’s alphabet: lower case is fine, hyphens between groups are skipped, and O, I and L would read as 0, 1 and 1.

Where Base32 is used

Two-factor secrets: the key behind a TOTP code (RFC 6238), as in an otpauth:// link or the text under a QR code, is Base32. Tor .onion addresses use the standard alphabet too, and DNSSEC NSEC3 records use the Hex one (RFC 5155).

The standard alphabet has only capital letters and the digits 2 to 7, so 0 and O, 1 and I or 8 and B can’t be confused, and case does not matter. Base32 is 60% longer than the bytes it holds; Base64 is 33% longer.

Standard and Hex alphabets

RFC 4648 defines two: the standard one (A–Z, 2–7) and the extended hex one (0–9, A–V), which keeps the sort order of the bytes. A wrong character is named with its line and column, and the error says when it belongs to the other alphabet (0, 1, 8 and 9 are only in Hex; W to Z only in the standard one).

Crockford’s Base32 (0–9 and A–Z without I, L, O and U) is the one ULIDs use; its decoder reads O as 0 and I or L as 1, and it has no padding. z-base-32 (lower case, its letters chosen to be easy to read aloud) is used by Tahoe-LAFS and by Lightning (lnd) message signatures. Neither pads with =.

When the last character carries bits past the last byte that are not 0 (MZ where MY is the canonical form), the bytes still decode and a note says so: RFC 4648 §3.5 lets a strict decoder refuse such input.

Sources: RFC 4648 §3.5 and §6, Douglas Crockford: Base32, z-base-32

Questions

Why does my secret decode to binary data?
TOTP secrets are random bytes, not text. The result shows them in hex, and Download saves the bytes as a file.
Does it read Crockford’s Base32?
Yes: pick Crockford. It decodes lower case, hyphens and the look-alikes O, I and L, and encodes without padding. A ULID is one 128-bit number written in that alphabet rather than bytes, so this page doesn’t turn it into a time.
Is my data uploaded?
No. Everything runs in your browser, so your data stays on your device. Nothing you paste is uploaded unless you share a result, which is locked with your password first. Two-factor secrets give access to an account: keep them out of chats and tickets.

Related tools