DevKits

CUID2 Generator — Secure, Collision-Resistant IDs for the Web

Generate CUID2 strings online — a modern, secure, collision-resistant ID format designed for horizontal scale and safe use in URLs, cookies, and databases. 100% local, no dependencies.

Last updated:

Comments
  • xmrvqlv6b18rzca10v3omx9b0
  • lmrvqlv6b220sdkysioba2u7a
  • qmrvqlv6b3t3pmv3evfzr1b2q
  • omrvqlv6b4i8lshp9hzce1n0j
  • gmrvqlv6b5cioruc9cvsrqfn4

Frequently Asked Questions

What is CUID2?

CUID2 is the successor to the original CUID, designed by Eric Elliott. It's a variable-length (default 25 chars), lowercase-only, URL-safe ID format that combines a timestamp, a per-process counter, a fingerprint, and cryptographic randomness. Widely adopted by Prisma and other ORMs.

Should I use CUID2 or UUID v7?

Both give you time-ordering and collision resistance. UUID v7 is standardized (RFC 9562) and understood by databases as a native UUID type; CUID2 is shorter, always lowercase, always URL-safe, and slightly more opinionated about entropy sources. Pick UUID v7 for interop with UUID-typed columns; pick CUID2 for cleaner-looking IDs in URLs.

Are CUID2s secure as authentication tokens?

No. The CUID2 spec is clear: CUID2 is a unique identifier, not a security token. Use a dedicated token generator (crypto.randomBytes → base64url) for anything involving authentication or authorization.

Related Tools