Skip to content
Utilboxes

UUID Generator

Generate valid UUIDs — random version 4, or time-ordered version 7 for database keys. Produce one or thousands.

Runs entirely in your browser

How to use the UUID Generator

  1. 1Choose the UUID version you need.
  2. 2Set how many to generate.
  3. 3Pick a format: standard hyphenated, uppercase, braced, or no hyphens.
  4. 4Copy the list, or download it as a text file.

How it works

A UUID is a 128-bit identifier that can be created independently anywhere without coordination, and still be unique in practice. Version 4 fills 122 of those bits with cryptographic randomness — enough that generating a billion a second for a century still leaves the chance of a collision negligible.

Version 7 solves a real problem with version 4. Random UUIDs arrive at a database in random order, which scatters writes across a B-tree index and fragments it badly. Version 7 puts a 48-bit millisecond timestamp at the front, so identifiers generated later sort later. Inserts land at the end of the index, and range queries by time become possible.

The trade-off is that version 7 leaks approximately when the identifier was created. For an internal primary key that is usually fine; for a public unguessable token, version 4 is the safer choice.

Both versions set the version and variant bits correctly, so the output validates against RFC 9562.

Worked example

Reading the structure of a UUID

  1. 0189d5f2-1e4c-7a3b-9c2d-4e5f6a7b8c9d
  2. The 13th character is the version — 7 here.
  3. The 17th character encodes the variant, always 8, 9, a or b.

Result: A valid RFC 9562 version 7 UUID whose first 48 bits are a timestamp.

Frequently asked questions

Should I use UUID v4 or v7?
v7 for database primary keys, because it sorts by creation time and keeps indexes compact. v4 for public tokens and anything where the creation time should not be inferable.
Can two UUIDs ever be the same?
In theory yes, in practice no. With 122 random bits you would need to generate around 2.7 × 10¹⁸ of them before a collision became likely.
Do I need to worry about the format?
The hyphenated lowercase form is the standard and works everywhere. Braced and uppercase variants exist mainly for older Microsoft tooling.
How many can I generate at once?
Up to ten thousand in one go, which is enough to seed a test database.