ULID / NanoID Generator

Generate time-sortable, collision-free ULIDs and short, URL-safe NanoIDs — one at a time or in bulk.

Runs 100% in your browser — the generated identifiers are never sent anywhere.

Try This Next

Finished here? These might be your next step.

Frequently Asked Questions

A ULID (Universally Unique Lexicographically Sortable Identifier) is a 26-character identifier carrying a millisecond-precision timestamp in its first 48 bits and randomness in the remaining 80 bits. Unlike UUID v4: when sorted lexicographically, it automatically sorts by creation time too — which makes it more index-friendly as a database primary key than a UUID (less index fragmentation).

NanoID's default length of 21 characters provides a collision resistance close to that of a UUID (36 characters), because it uses a wider alphabet (64 characters, A-Za-z0-9_-) — each character carries more information than UUID's hex alphabet (16 characters). This makes it a more practical, shorter identifier for URLs and file names.

Instead of taking bytes from crypto.getRandomValues and simply taking the modulo of the alphabet length, this tool uses rejection sampling: it discards bytes that fall into the remainder of 256 that doesn't divide evenly by the alphabet length. This guarantees each character is chosen with equal probability, avoiding bias even for arbitrary-length alphabets.

Last updated: