Tools

Free Online UUID / ULID / NanoID Generator

Generate UUID v4, UUID v1, ULID, and NanoID instantly in your browser — up to 100 IDs at once. 100% client-side, no data sent to server.

All generation happens locally in your browser via the Web Crypto API. No IDs or text are ever sent to our servers.

What is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit label defined in RFC 4122. With over 5 × 10³⁶ possible v4 values, the probability of generating the same UUID twice is astronomically small. UUIDs allow distributed systems to create unique identifiers — for database rows, API resources, session tokens — without a central counter or coordinator.

UUID v4 vs UUID v1 vs ULID vs NanoID

Choose the right identifier for your use case:

UUID v4 (128-bit random)

Completely random. The most widely used format, supported natively by all modern databases and languages. No temporal information. Generate with crypto.randomUUID().

UUID v1 (timestamp-based) Legacy

Encodes a timestamp for time-ordered sorting. Deprecated for new systems — the original spec exposes the MAC address, raising privacy concerns. Use ULID instead if you need sortability.

ULID (Universally Unique Lexicographically Sortable)

Lexicographically sortable by creation time — ideal as a database primary key with Prisma, Drizzle, or any ORM. 26-char Crockford Base32, URL-safe, case-insensitive.

NanoID (compact URL-safe ID)

Only 21 characters (vs 36 for UUID), URL-safe alphabet (A-Za-z0-9_-). Configurable length. Perfect for URL slugs, short tokens, and generated identifiers.

When to Use Each Identifier

Practical guidance for choosing the right ID format:

UUID v4 → Database Primary Keys

Use UUID v4 as primary keys in PostgreSQL (uuid type), MySQL (CHAR(36)), or any database that supports UUIDs natively. Supported by all major ORMs.

UUID v1 → Time-Ordered Log Files

Legacy systems that need timestamp-embedded IDs for log file naming or event ordering. Prefer ULID for new projects.

ULID → Sortable Primary Keys with ORMs

Use ULID when you need primary keys that sort by creation time without a separate timestamp column. Works out-of-the-box with Prisma, Drizzle ORM, and TypeORM.

NanoID → URL Shorteners & Compact Tokens

Use NanoID for URL slugs, short-lived tokens, and any context where compactness and URL-safety matter. Adjust length to balance collision probability and readability.

Frequently Asked Questions

UUID is a 128-bit identifier encoded as 36 hex characters with dashes (e.g., 550e8400-e29b-41d4-a716-446655440000). ULID is also 128 bits but encoded as 26 Crockford Base32 characters and is lexicographically sortable by creation time. ULID is a modern alternative to UUID v1 that avoids MAC address exposure.

In theory yes, but the probability is negligibly small. UUID v4 has 122 bits of randomness, yielding about 5.3 × 10³⁶ possible values. To have a 50% chance of a collision you would need to generate approximately 2.7 × 10¹⁸ UUIDs — far beyond any real-world system.

Yes. UUID v4 is widely used as a primary key in distributed systems. The main trade-off vs. sequential integers is index fragmentation in B-tree indexes. If ordered inserts matter, consider ULID instead, which sorts chronologically and reduces fragmentation.

NanoID generates shorter IDs (default 21 characters vs 36 for UUID) using a URL-safe alphabet. The length is configurable: shorter IDs have higher collision probability, longer IDs are safer. NanoID is ideal for URLs, slugs, and compact tokens where UUID's 36-character format is too long.