Advertisement

CUID2 Generator

Generate CUID2 identifiers: short, lowercase, URL-safe unique IDs that always start with a letter. A modern alternative to UUIDs for web apps, database keys and anywhere an ID must survive URLs and copy-paste.

CUID2 options

Lowercase, URL-safe, always starts with a letter.

Press Generate IDs.

Everything runs locally. Nothing is sent to any server.

Advertisement

What CUID2 is

CUID2 IDs are lowercase alphanumeric strings (a-z, 0-9) that always start with a letter, which makes them safe for URLs, HTML ids, database keys and JavaScript variable names without escaping. The reference implementation hashes entropy with SHA-3; this tool draws from the browser's cryptographic random source and matches the same format, length range and leading-letter rule.

Why developers pick CUID2

Because CUID2 strings never contain uppercase letters, hyphens or special characters, they survive case-insensitive filesystems, URL routing and copy-paste without mangling. They are popular in Prisma-era apps as an alternative to auto-increment integers, which leak row counts and creation order.

CUID2 Generator FAQs

CUID2 vs UUID, which is better?
Both are collision-resistant unique IDs. CUID2 is shorter, URL-safe by default and always starts with a letter, while UUID v4 is a fixed 36-character standard with hyphens. Use CUID2 for web-facing IDs and UUIDs where a formal standard is required.
Are CUID2 IDs collision-safe?
With 24 characters of base-36 entropy there are about 2^124 possibilities, comparable to a UUID. The leading letter is fixed, which costs almost nothing in practice.
Are CUID2 IDs URL safe?
Yes. They contain only lowercase letters and digits, with no uppercase, hyphens, plus signs or slashes, so they need no percent-encoding and work in path segments, query strings and HTML attributes.
Can I use CUID2 as a secret token?
They are unpredictable, but they are identifiers, not secrets. Never use them as passwords, session tokens or API keys without additional cryptographic measures.
What length should I choose?
Increase the length toward 32 characters. Longer IDs carry more entropy, which is the only knob that matters for collision resistance.
Advertisement