Use CUID2 Generator

Enter your data below to use the CUID2 Generator

📌 Try these examples:
RESULT

Last updated

What Is CUID2?

CUID2 (Collision-resistant Unique IDentifier v2) is a modern unique ID format designed for distributed systems. It improves on the original CUID by using SHA-3 hashing, a larger alphabet, and better entropy sources. CUID2 IDs are URL-safe, start with a letter (making them valid HTML IDs), and are designed to be secure against fingerprinting attacks.

CUID2 vs Other ID Formats

FormatLengthSortableURL-safeSecure
UUID v436 charsNoNo (hyphens)Yes
UUID v736 charsYes (time-based)NoYes
ULID26 charsYesYesYes
NanoID21 charsNoYesYes
CUID224 charsNoYesYes
Snowflake18 charsYesYesNo (predictable)

Generating CUID2

JavaScript
import { createId, isCuid } from '@paralleldrive/cuid2';

// Generate a CUID2
const id = createId();
console.log(id); // → 'clh3ik5yx0000356dcf3dn2wr'

// Validate a CUID2
console.log(isCuid(id)); // → true

// Custom length (default is 24)
import { init } from '@paralleldrive/cuid2';
const createShortId = init({ length: 10 });
console.log(createShortId()); // → 'clh3ik5yx0'

// Use as database primary key
const user = {
  id: createId(),
  name: 'Alice',
  createdAt: new Date()
};

Frequently Asked Questions

Simply enter your data, click the process button, and get instant results. All processing happens in your browser for maximum privacy and security.

Yes! CUID2 Generator is completely free to use with no registration required. All processing is done client-side in your browser.

Absolutely! All processing happens locally in your browser. Your data never leaves your device, ensuring complete privacy and security.