DevsToolkit

Identifiers Tools

5 tools

Generate and validate unique identifiers — UUID, ULID, NanoID, CUID, and tokens

UUID vs ULID vs NanoID vs CUID — which should I use?

Modern applications have moved beyond UUID v4 as the default identifier. Different ID schemes optimize for different goals — sortability, length, URL-safety, or unguessability. Here is how the most common ID formats compare, and which one fits each use case.

FormatLengthAlphabetSortableBest for
UUID v436 chars (32 hex + 4 hyphens)Hex 0-9, a-fNo — fully randomDefault choice when you need a globally unique identifier and don't care about ordering.
UUID v736 charsHex 0-9, a-fYes — 48-bit Unix ms prefixModern replacement for v4 in databases — time-ordered, index-friendly, and still random enough for collision resistance.
ULID26 charsCrockford Base32 (no I, L, O, U)Yes — 48-bit Unix ms prefixLexicographically sortable IDs that are URL-safe and shorter than UUIDs. Great for logs, events, and primary keys.
NanoID21 chars (configurable)URL-safe (A-Za-z0-9_-)NoShort, URL-safe public IDs (share links, slugs, file names) where you want fewer characters than UUID.
CUID224 chars (configurable)Lowercase a-z + 0-9No (intentional)Distributed systems where unguessability matters and you don't want to leak creation time.

Need a sortable ID?

Pick a time-ordered format so your database index stays sequential. Try the ULID Generator or generate UUID v7 in bulk.

Need a short, URL-friendly ID?

A 21-character NanoID is roughly as collision-safe as a UUID v4 but 15 characters shorter. The NanoID Generator also lets you customize the alphabet.

Need to hide creation time?

UUID v1, v7 and ULID all leak the moment the ID was generated. If that's a privacy or enumeration risk, use the CUID Generator (CUID2) instead.

Have an existing ID and want to parse it?

The UUID Validator decodes the version, variant, and embedded timestamp (for v1 and v7) from any canonical or braced UUID string.

Generating fixtures or seeding a database?

The Bulk UUID Generator produces up to 100,000 UUIDs at once and lets you download the list as a .txt file.

Already use UUIDs everywhere?

Keep the UUID Generator for one-off v4 IDs — and validate any UUID you find with the validator above.