1001Ferramentas
๐Ÿ”ขValidators

Base32 Crockford Validator

Check if a string uses only the Base32 Crockford alphabet (omits I, L, O, U to avoid ambiguity). Common in human-readable IDs.

โ€”

Crockford's Base32: human-friendly encoding behind the ULID

Crockford's Base32, designed by Douglas Crockford, is a Base32 variant optimised for humans reading and typing identifiers. It uses 0โ€“9 and the letters Aโ€“Z but deliberately excludes I, L, O and U โ€” the first three to avoid confusion with 1 and 0, and U to avoid accidental profanity. This tool validates the character set (case-insensitive, hyphens ignored).

The example above, 01ARZ3NDEKTSV4RRFFQ69G5FAV, is a ULID โ€” a 26-character, lexicographically sortable identifier whose encoding is Crockford Base32. That makes this alphabet the backbone of modern sortable IDs.

What makes it forgiving

  • Case-insensitive: decoders accept upper or lower case and normalise to uppercase.
  • Confusable substitutions on decode: O โ†’ 0, and I / L โ†’ 1, so a human typo still decodes correctly.
  • Hyphens are ignored: you may insert - for readability and they're stripped before decoding.
  • Optional check symbol: Crockford defines a mod-37 check character (*, ~, $, =, U) that some implementations append.

Where it shows up

  • ULID: 48-bit timestamp + 80-bit randomness, encoded as 26 Crockford chars โ€” sortable and URL-safe.
  • Public IDs & coupons: short codes meant to be read aloud, dictated over the phone or printed on receipts.
  • Key shards & licences: where transcription errors must be tolerated.
  • Mock data / testing: checking a token is well-formed Crockford before parsing.

Gotchas

  • Not RFC 4648: Crockford is a separate spec; don't decode it with a standard Base32 or Base32hex table.
  • Exclusions are the point: seeing I, L, O or U in canonical output means it isn't canonical Crockford.
  • Check symbol โ‰  data: if a trailing check char is present, don't feed it into the value decode.
  • ULID monotonicity: two ULIDs in the same millisecond rely on the random part; sortability is millisecond-granular, not strictly unique-ordered.

FAQ

Why exclude I, L, O, U? I/L look like 1, O looks like 0, and U is dropped to avoid spelling rude words โ€” all to make hand-typed codes reliable.

Is a ULID just Crockford Base32? A ULID is a 128-bit value whose text form is 26 Crockford Base32 characters; the encoding is Crockford, the structure (time + random) is ULID's own.

Does it preserve sort order like Base32hex? Yes for the canonical alphabet โ€” which is why ULIDs sort chronologically as plain strings.

Related Tools