0x
0xkit.dev
/CUID / NanoID

CUID2 / NanoID / ULID

Generate collision-resistant unique identifiers. Configurable alphabet, length, batch size.

count:
Charseta-z, 0-9
Length24
Entropy~119 bits
SortableNo
50% collision at~576460752 billion IDs

CUID2 vs NanoID vs ULID — When to Use Which?

CUID2 generates 24-character IDs that are collision-resistant even across distributed systems. It mixes a CSPRNG, process fingerprint, and timestamp (all hashed together) to produce IDs safe for horizontal scaling. Best for: distributed databases, microservices.

NanoID is a compact, URL-friendly ID generator that uses crypto.getRandomValues(). Its key advantage is a customizable alphabet — hex IDs, lowercase-only, numeric codes, or any format. Default NanoID (21 chars) provides ~126 bits of entropy. Best for: URL slugs, short tokens, file names.

ULID (Universally Unique Lexicographically Sortable Identifier) encodes a 48-bit millisecond timestamp in the first 10 characters, followed by 80 bits of randomness. This makes ULIDs chronologically sortable — lexicographic order equals creation order. Uses Crockford's Base32 encoding (26 chars total). Best for: time-series data, database primary keys where sort order matters, event logs.

All three use CSPRNG and run client-side — your IDs are generated locally.