UUID generator: v4 and v7
This UUID generator makes one UUID or up to 10,000 at once, as random version 4 or time-ordered version 7. They are made on your device, so nobody else sees them.
How to make UUIDs
- Pick v4 or v7.
- Set how many. They appear at once.
- Copy them, or save a longer list as a file.
Questions
Should I use v4 or v7?
Use v7 for database keys, and v4 when an ID must reveal nothing. A v7 UUID starts with the time, so new rows land together in an index. That same time can be read by anyone who holds the UUID, including when it was made to the millisecond.
How are they made?
Version 4 comes straight from your browser's crypto.randomUUID. Version 7 follows RFC 9562: a 48-bit millisecond time, a 12-bit counter that starts at a random value, then 62 random bits from crypto.getRandomValues. Our test reads every one with Python's uuid module and checks the version, the variant and the time.
Do v7 UUIDs sort in the order they were made?
Yes, within one page. When several land in the same millisecond, the counter keeps them in order, and our test sorts 10,000 of them to confirm it. If 2,048 or more land in one millisecond, or your clock goes back, the time in later ones moves ahead of the clock by a little to hold the order. UUIDs from different pages or machines made in the same millisecond have no set order.
Can two UUIDs ever be the same?
In practice, no, as long as the browser's random source works. A version 4 UUID has 122 random bits, so a repeat is too unlikely to plan for. Nothing here checks against other people's UUIDs, because nothing is sent anywhere.
Are they saved or sent?
No. The page makes no request with them and stores nothing. You can check the page's requests yourself.