UUID Generator
Generate valid UUIDs — random version 4, or time-ordered version 7 for database keys. Produce one or thousands.
How to use the UUID Generator
- 1Choose the UUID version you need.
- 2Set how many to generate.
- 3Pick a format: standard hyphenated, uppercase, braced, or no hyphens.
- 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
- 0189d5f2-1e4c-7a3b-9c2d-4e5f6a7b8c9d
- The 13th character is the version — 7 here.
- 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.