CUID2 Generator

Generator

Generate collision-resistant CUID2-style identifiers, 24-32 characters, always starting with a letter. Runs entirely in your browser.

Options
IDs
Click Generate to create one or more CUID2-style IDs

About this tool

About CUID2 Generator

CUID2 is a collision-resistant identifier format designed to fix predictability issues in the original CUID: it always starts with a lowercase letter (for compatibility with HTML element IDs and CSS class names, which can't start with a digit), followed by lowercase base36 characters, for a total length configurable from 24 to 32 characters (default 24).

This generator mixes several entropy sources — the current timestamp, an internal counter, 16 bytes of cryptographically random data, and a browser fingerprint (derived from your user agent and screen dimensions) — and hashes them together with SHA-512. The reference CUID2 implementation uses SHA3-512 internally, which isn't available in the browser's native Web Crypto API; SHA-512 is an equally well-audited hash, so the output is just as collision-resistant, but it won't produce byte-identical IDs to another CUID2 library given the same inputs.

Use this to generate test CUID2-style IDs for database primary keys, distributed systems that need collision-resistant IDs without central coordination, or any system migrating from sequential integer IDs to a format that doesn't leak record counts.

Instant generation entirely in your browser. Every generated ID is guaranteed to start with a letter (safe for HTML IDs) and uses well-audited cryptographic hashing to mix entropy — this project is privacy-first, so the browser fingerprint used for entropy never leaves your device.

Key Features

  • Configurable length from 24 to 32 characters
  • Generates 1-1,000 IDs at once
  • Always starts with a lowercase letter for HTML/CSS ID compatibility
  • Mixes time, counter, randomness, and browser fingerprint entropy via SHA-512
  • One-click copy for individual IDs or the whole batch
  • 100% browser-based — even the fingerprint entropy never leaves your device

FAQ

CUID2 Generator — Frequently Asked Questions

What is CUID2?

CUID2 is a collision-resistant unique identifier format, the successor to the original CUID (now considered deprecated due to predictability issues in its algorithm). It's commonly used as a primary key format in modern web applications, particularly with ORMs like Prisma.

Why does a CUID2 always start with a letter?

So the ID can be safely used as an HTML element ID or a CSS class name, neither of which are allowed to start with a digit. Starting with a letter avoids an entire category of bugs when IDs get used directly in markup or selectors.

Does this generator produce byte-identical output to the official @paralleldrive/cuid2 library?

No, and this is documented rather than hidden: the reference implementation mixes entropy using SHA3-512, which isn't available in browsers' native Web Crypto API. This generator uses SHA-512 instead — an equally well-audited cryptographic hash — so IDs are just as collision-resistant and match the CUID2 format exactly, but won't be byte-identical to another CUID2 library given the same inputs.

What entropy sources does this generator mix together?

The current timestamp, an internal counter that increments with every ID generated in your session, 16 bytes of cryptographically random data, and a fingerprint derived from your browser's user agent string and screen dimensions — all hashed together to produce the final ID.

Is my browser fingerprint sent anywhere?

No. The fingerprint is used only as one entropy input to the local hash computation — it's never transmitted, logged, or stored. Everything happens entirely within your browser.

Tips

  • The default length of 24 characters matches the most common CUID2 usage — increase it up to 32 only if your schema specifically requires longer IDs
  • Generate a batch of 1,000 at once if you need realistic-looking seed data for a database that uses CUID2 primary keys
  • Every generated ID always starts with a lowercase letter, so it's always safe to use directly as an HTML id attribute
  • This generator never sends anything to a server — every ID, including the entropy that goes into it, stays entirely in your browser

Explore more

Related Tools

Other tools that might be useful for your workflow