Generator Tools
CUID2 Generator
Generate CUID2 ids in your browser with crypto.getRandomValues and SHA3-512. Configurable length, batch output, and a built-in CUID2 validator.
CUID2 generator
Length preset
Pick a built-in size or type a custom value below. CUID2 ids must be 2 to 32 characters; the canonical size is 24.
Generated ids (0)
Click Generate ids to produce a fresh batch. Each id starts with a random lowercase letter and continues with base36 characters derived from the SHA3-512 of the entropy buffer.
Keyspace and collision probability
Sized against the 36-character base36 alphabet at the current length. Use the numbers to decide when a longer id is worth the extra storage.
Total id space
2.25 x 10^37
36^24 possible values
Entropy per id
124.08 bits
Approx. bits of unique information
Safe at 1% collision
~6.72 x 10^17
Ids before P(collision) reaches 1%
Safe at 50% collision
~5.58 x 10^18
Ids before P(collision) reaches 50%
Validate a CUID2
Paste any string to check whether it matches the CUID2 format. The official isCuid validator accepts ids of 2 to 32 characters that start with a lowercase letter and contain only base36 characters.
Paste a value above to validate it.
CUID2 vs UUID, ULID, and NanoID
- UUID v4: 36 hyphenated characters, 122 bits of randomness, no time component. CUID2 ids are shorter (default 24), use a smaller alphabet, and hash the entropy so the surface area of leaked timestamps and counters is reduced.
- UUID v7 / ULID: both encode time at the start of the id so they sort by creation. CUID2 deliberately does not, because the spec assumes you do not want to leak when a row was created to an attacker scraping public ids.
- NanoID: a random-only id with a configurable alphabet. CUID2 layers in a counter and a session fingerprint, then hashes the result, so two concurrent tabs are extremely unlikely to collide even if the underlying RNG produces a duplicate.
- When CUID2 wins: public-facing ids (share links, slugs, document ids) where you want a short, alphabetically-safe string that does not advertise creation time.
Implementation notes
- First character: a random lowercase letter from a-z. This is what guarantees the id starts with a valid identifier character, so you can use it as a JavaScript variable or a CSS class name without escaping.
- Hash input: time + entropy + counter + session fingerprint, hashed with SHA3-512 and base36-encoded. The first base36 character is dropped to remove the leading-bias.
- Randomness: every call to randomBase36Char and randomLetter uses crypto.getRandomValues with rejection sampling so the distribution is unbiased.
- Counter: a per-session 32-bit unsigned counter, started from a random value so two pages opened at the same instant never produce the same id sequence.
How to use
- Pick a length preset (Canonical 24, Compact 16, Short 10, or Extended 32) or type a custom length between 2 and 32.
- Choose how many ids to generate (1 to 1000) and click Generate ids. Each id starts with a random lowercase letter and continues with base36 characters derived from a SHA3-512 hash of fresh entropy.
- Use the per-row Copy buttons to grab a single id or Copy all to copy the whole batch as a newline-separated list.
- Open the keyspace panel to see the total id space and the birthday-paradox safety thresholds at 1% and 50% collision probability for the current length.
- Paste any string into the validator to check whether it is a well-formed CUID2 and read the exact reason on failure (too short, too long, wrong first character, non-base36 character).
About this tool
CUID2 Generator produces ids that follow the canonical paralleldrive/cuid2 algorithm: a random lowercase first letter, then the first base36 characters of the SHA3-512 hash of a time-plus-entropy-plus-counter-plus-fingerprint buffer, sized to the length you pick (2 to 32 characters, default 24). Every random source uses crypto.getRandomValues with rejection sampling so the alphabet is unbiased, and the SHA3-512 step is implemented locally because Web Crypto does not expose SHA-3 in browsers. The first letter guarantees the id is always a valid JavaScript identifier or CSS class name, which is the property that makes CUID2 a popular drop-in for UUIDs in libraries like Prisma, Sanity, and PartyKit. The result panel lists every id with per-row copy buttons and a single Copy all action for the full newline-separated batch. A keyspace panel reports the entropy in bits and the birthday-paradox threshold at 1% and 50% collision probability so you can pick a length that fits your scale before they go to production. A built-in validator runs the same checks the official isCuid function ships: length between 2 and 32, first character a-z, body in the lowercase base36 alphabet, with an exact reason on failure. Everything runs locally; nothing you generate or paste is uploaded.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
UUID Generator
Generate UUID v4 identifiers in batch.
Open tool
GeneratorUUID v7 Generator
Time-ordered UUID v7 generator and version-aware UUID decoder.
Open tool
GeneratorULID Generator
Generate sortable ULID identifiers and decode any ULID back into its timestamp.
Open tool
GeneratorNanoID Generator
Generate URL-safe NanoID identifiers with custom alphabets, sizes, and batches.
Open tool
GeneratorUUID v5 Generator
Deterministic name-based UUIDs (v3 MD5 and v5 SHA-1) with standard namespaces and batch mode.
Open tool
DeveloperUUID Validator
Validate UUIDs, identify the version and variant, and decode v1, v6, and v7 timestamps.
Open tool