Crockford Base32 Encoder and Decoder

Convert text, hex bytes or files to Douglas Crockford's Base32 and back. The decoder forgives typing mistakes: it ignores case and hyphens and reads O as 0 and I or L as 1.

Runs entirely in your browser. Nothing is uploaded.

How to use

  1. Choose Encode to turn text into Crockford Base32, or Decode to turn it back into text.
  2. Keep the Crockford variant selected and make sure Padding is off. Turn on Lowercase for lowercase output.
  3. Type or paste your input, or open a file. When decoding, hyphens and spaces are ignored.
  4. Copy the result or download it as a file.

What is Crockford Base32?

Douglas Crockford designed this Base32 alphabet for identifiers that people read, type and say aloud. It uses the ten digits and 22 uppercase letters: 0123456789ABCDEFGHJKMNPQRSTVWXYZ. The letters I and L are left out because they look like the digit 1, O because it looks like 0, and U to reduce the chance of accidentally spelling obscene words.

Each symbol carries 5 bits, so 5 bytes become 8 characters, just like RFC 4648 Base32. The symbols are in ascending ASCII order, so unpadded strings in one letter case sort in the same order as the data they encode. Crockford's specification uses no padding, so keep the Padding option switched off.

Forgiving decoding

Crockford's specification asks decoders to accept what people actually type, and this tool does:

  • Uppercase and lowercase letters are treated the same.
  • The letter O is read as the digit 0, and the letters I and L are read as 1.
  • Hyphens, which may be inserted to make long codes easier to read, are ignored, and so are spaces and line breaks.

The letter U is not valid and is reported with its position.

Bytes, numbers and ULID

Crockford describes his encoding in terms of numbers, while this tool encodes a sequence of bytes in 5-bit groups, the RFC 4648 way, using Crockford's symbols. When the number of bits is not a multiple of 5, number-based implementations put the spare zero bits at the front and this tool puts them at the end, so the results can differ.

ULID is a common example. It uses the Crockford alphabet but encodes its 128-bit value as a number in 26 characters, so the 16 bytes of a ULID do not encode to the same string here, and decoding a ULID gives bytes shifted by two bits. The optional check symbol from Crockford's specification, an extra character for the value modulo 37, is not supported: this tool neither adds nor verifies it.

Specification

Alphabet0-9 A-Z without I L O U
Output size8 characters per 5 bytes (160%)
PaddingNone
StandardCrockford Base32 (2002)
Case sensitiveNo

Examples

Input (UTF-8)Output
Hello, World!91JPRV3F5GG5EVVJDHJ22
Base64.is89GQ6S9P6GQ6JWR
你好WJYT1SD5QM

Frequently asked questions

Is Crockford Base32 case sensitive?

No. The output is uppercase by default, and the Lowercase option switches it to lowercase. The decoder accepts both, even mixed in one string.

Why are I, L, O and U missing from the alphabet?

I and L are easily mistaken for 1, and O for 0, so they are left out and read as those digits when decoding. U is excluded so that random codes are less likely to form offensive English words.

Does this tool support the Crockford check symbol?
No. The specification allows an optional extra character holding a checksum modulo 37, which uses the additional symbols * ~ $ = U. This tool does not add or verify it, so remove a check symbol before decoding.
Can I decode a ULID here?

Not into its exact 16 bytes. ULID encodes its 128 bits as one number with the spare bits at the front, while this tool works with byte groups and puts them at the end. Use a ULID library to read the timestamp and random parts.