Developer

CUID Generator

Generate CUID-style IDs — a 'c' prefix, base36 timestamp and counter, and random characters — at a length of 10 to 32.

Loading interactive tool…

Embed this tool on your site

About this tool

The CUID Generator creates lowercase, CUID-style identifiers in your browser. Each ID is built as the letter c, the current millisecond timestamp in base36, a base36 counter that increases with every ID made in this page session, and random base36 characters drawn from the Web Crypto API, then cut to the length you pick with the Length slider (10 to 32, default 24). A Count slider makes 1 to 50 IDs per click, with Copy per ID and Copy All. This is a simplified scheme inspired by Eric Elliott's CUID, not an implementation of the official cuid or CUID2 libraries: there is no host fingerprint, no SHA-3 hash and no CUID2 mode, so IDs will not match what those packages produce. Because the timestamp and counter fill the first 11 characters, short lengths leave little or no randomness; at length 10 IDs generated in the same millisecond repeat. Choose 20 or more characters when you need collision resistance. Output uses only a-z and 0-9, so it is safe in URLs and HTML id attributes.

Why use it

  • Lowercase alphanumeric — safe for URLs, HTML IDs, and database keys.

  • No coordination or central ID server needed.

  • Starts with a millisecond timestamp, so IDs from different moments sort roughly by creation time.

  • Random characters come from crypto.getRandomValues rather than Math.random.

  • Quick batches of up to 50 IDs with one-click copy for fixtures and sample data.

How to use

  1. Move the Length slider (10-32, default 24) to set how many characters each ID has.
  2. Move the Count slider (1-50) to choose how many IDs to make.
  3. Click Generate to create the batch; ten IDs are generated when the page loads.
  4. Click Copy next to an ID, or Copy All to copy the batch one per line.
  5. Keep the length at 20 or more for real IDs: the first 11 characters are the c prefix, timestamp and counter, and only the rest is random.

When it helps

  • Generating unique IDs on the client side without a server round-trip.
  • Generating unique HTML element IDs in dynamic UIs.
  • Producing readable sample IDs for unit and integration tests where lowercase strings are easier to scan than UUID hex.
  • Mocking up data that should look like CUIDs before wiring in the real cuid or CUID2 library.
  • Seeing how a timestamp-plus-counter-plus-random ID is put together while learning about ID formats.

Examples

Default length

Input
Length: 24, Count: 3
Expected result
cmva2rj4w0a1l30353d5o2m4
cmva2rj4w0b3o1l3y6f6nu2v
cmva2rj4w0c6v3m306l2v3q1

Longest length

Input
Length: 32, Count: 1
Expected result
cmva2rj4w0d23q3q5j443f2p2v595f5x

Too short to be unique

Input
Length: 10, Count: 10
Expected result
cmva2rj4v0 repeated for every ID made in the same millisecond (c + 8-character timestamp + first counter character, no random part)

Tips

  • For production systems use the official @paralleldrive/cuid2 package; this page is for quick sample IDs, not a drop-in replacement.
  • Keep the length at 20 or more characters; below 12 the ID has no random part and duplicates appear within one batch.
  • IDs from one batch share the same timestamp prefix and differ in the counter and random tail, so do not treat the order inside a batch as meaningful.
  • Do not pass user input through ID generation; identifiers should come from random and time sources only.
  • When migrating from CUID v1 to CUID2, never coerce the legacy IDs to the new format — keep them side by side and add new IDs as a separate column.
  • Treat all CUIDs as opaque strings in your schema. Any code that parses a CUID's structure couples you to the implementation and breaks across major versions.

Frequently Asked Questions

Is this the official CUID or CUID2 algorithm?
No. The tool builds a CUID-style string itself: 'c', a base36 timestamp, a base36 session counter and random base36 characters, cut to your chosen length. It has no host fingerprint and no SHA-3 hash, so it is neither CUID v1 nor CUID2 and its IDs are not interchangeable with those libraries' output.
What is the difference between CUID and CUID2?
In the official libraries, CUID v1 combines a timestamp, counter, host fingerprint and randomness and starts with 'c'. CUID2 hashes its inputs with SHA-3 to remove the predictability of v1. This tool offers neither as a mode; every ID it makes starts with 'c'.
Which length should I choose?
20 characters or more. The first 11 characters are fixed structure (c, 8-character timestamp, 2-character counter), so a 24-character ID has 13 random characters and a 32-character ID has 21. At length 10 there is no random part at all and IDs made in the same millisecond come out identical.
How does CUID compare to UUID?
CUID-style IDs start with a timestamp and counter for rough sortability; UUID v4 is purely random. CUID IDs are all-lowercase alphanumeric; UUID uses hexadecimal with dashes.
Can CUIDs be used as HTML element IDs?
Yes. They are all-lowercase letters and digits starting with the letter c, which is valid for HTML id attributes.
Are these IDs safe as secret tokens?
No. The timestamp and counter are predictable and the random part is short and built from base36 renderings of random bytes, which are not evenly distributed. Use them as identifiers, not as session tokens or password reset codes.

Explore the category

Glossary

CUID
Collision-resistant Unique Identifier — a structured ID format introduced by Eric Elliott in 2012 that combines timestamp, counter, fingerprint, and randomness.
CUID2
A 2022 redesign of CUID using SHA-3 hashing to remove host fingerprint leakage and predictability; default length is 24 characters. Not implemented by this tool.
Host fingerprint
A short hash derived from the client device or process used in CUID v1 to differentiate concurrent generators; removed in CUID2 due to leakage concerns.
Counter component
An incrementing number that disambiguates IDs generated in the same millisecond by the same client; this tool's counter runs for the life of the page.
Base36
A number system using digits 0-9 and letters a-z. The tool writes the timestamp and counter in base36 to keep IDs short and lowercase.
URL safety
Property of an ID format that uses only characters valid in URLs without percent-encoding; lowercase alphanumeric IDs are URL-safe by design.
A LITTLE HELP. A LOT DONE.
Good tools.
Great flow.

Your shortcut to the everyday. Create, convert, calculate,
and get back to what you love.

✓ Free to use✓ No sign-up✓ 500+ possibilities