Generate CUID2

Generate a lowercase, URL-safe Cuid2-style identifier for a public record.

freeworks offlinenothing uploaded
ToolCUID2 Generator
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

A lowercase letter prefix is followed by a collision-resistant digest derived from time, counter, entropy, and session context; optional length truncates the identifier. The result is opaque public-ID text.

  • The prefix keeps IDs valid as common names.
  • Entropy and a counter reduce collisions during rapid calls.

Worked example

Default CUID2
Generate a 24-character CUID2
Input
											Length: 24
Count: 1
										
Output
												hwbcdbcysksymsffqpayvczh
											

When to use this

Web URLs, optimistic client records, and opaque database keys use Cuid2-style IDs.

Edge cases

  • Shortening the ID reduces collision resistance.
  • An ID is not a cryptographic secret.
  • Clock changes do not make IDs strictly monotonic.

References