A UUID generator produces universally unique identifiers in bulk for fixtures, seed scripts and API mocks. This one covers eight formats — UUID v4, v7 and v1, the nil UUID, ULID, Nano ID, CUID2-style IDs and MongoDB ObjectIds — with options for casing, hyphens and braces, and a column showing the timestamp embedded in the time-ordered formats.
The difference between those formats matters most in databases. UUID v4 is random, so every insert lands in a different page of the primary-key index. UUID v7 and ULID put a timestamp first, so they sort by creation time and insert sequentially. Both are here, and both increase monotonically down a batch.
How to use it
- Pick the identifier type.
- Choose lowercase or uppercase, and whether to keep hyphens or wrap in braces — the variations different systems store.
- For Nano ID, set the length. For v7, ULID and ObjectId, switch on the timestamp column to check ordering at a glance.
- Generate as many as you need and copy them as a list, JSON, CSV or SQL.
What you can control
- UUID v4 (random), v7 (time-ordered) and v1 (timestamp and node), plus the nil UUID.
- ULID, Nano ID (8–40 characters), CUID2-style IDs and 24-character MongoDB ObjectIds.
- Lowercase or uppercase; with or without hyphens; optional braces, as in Microsoft GUIDs.
- The embedded timestamp as its own column for v7, ULID and ObjectId.
- Time-ordered formats that increase monotonically through the batch.
Choosing a format
| Format | Length | Sortable by time | Best for |
|---|---|---|---|
| UUID v4 | 36 | No | Opaque public IDs, where creation order should not leak |
| UUID v7 | 36 | Yes | Database primary keys (RFC 9562, 2024) |
| UUID v1 | 36 | Partly | Legacy systems; embeds a MAC-style node ID |
| ULID | 26 | Yes | Keys that appear in URLs or logs |
| Nano ID | 21 (adjustable) | No | Short URL-safe IDs |
| ObjectId | 24 | Yes (seconds) | MongoDB documents |
UUID v7 was standardised in RFC 9562 in May 2024, which replaced RFC 4122. PostgreSQL 18 added a built-in uuidv7() function; on older versions, or in application code, a library generates them.
Testing ideas
- Case sensitivity. Generate uppercase UUIDs and look one up through your API. If the database compares as text,
A1B2…anda1b2…may not match. - Hyphen-less input. Some clients send 32 hex characters with no hyphens. Decide whether to accept them, and test that decision.
- Nil UUID. Send
00000000-0000-0000-0000-000000000000to an endpoint that expects an existing ID. It should be a 404 or a validation error, never a match. - Sort order. Insert a batch of v7 IDs in random order and query by ID. They should come back in creation order.
- Column type. Store a ULID in a native
uuidcolumn and see what breaks; it needs converting first.
What this is not
These IDs come from a seeded pseudo-random generator, so they are reproducible and predictable. That is right for fixtures and wrong for anything that must be unguessable. Use crypto.randomUUID() or your database's generator in production.