UUID Generator
Generate random UUID v4 and time-ordered UUID v7 identifiers, one or thousands at a time. Cryptographically random, generated in your browser.
On your device: nothing you enter here is uploaded.
Result
The result appears here as you type.
What this tool is for
Generate UUIDs in bulk for seeding a database, writing tests or naming resources. Version 4 is fully random. Version 7, standardised in 2024, puts a timestamp in the high bits so identifiers sort chronologically, which makes them far kinder to a database index than v4.
Anatomy of a UUID
A UUID is 128 bits written as 32 hexadecimal digits in five groups, 8-4-4-4-12, for example 550e8400-e29b-41d4-a716-446655440000. The first digit of the third group is the version, so a version 4 UUID always has a 4 there. The first digit of the fourth group is the variant and is 8, 9, a or b for standard UUIDs.
In a v4 UUID the other 122 bits are random. In a v7 UUID the first 48 bits are a Unix timestamp in milliseconds, followed by the version and variant fields and a mix of counter and random bits. Values from different milliseconds sort in creation order; within the same millisecond the order is best effort, so do not rely on v7 alone as a strict sequence number.
UUID versions compared
| Version | Built from | Use it for |
|---|---|---|
| 1 | Timestamp and MAC address | Legacy systems; leaks the machine and time |
| 3 | MD5 hash of a name | Same input always gives the same ID |
| 4 | Random bits | General purpose identifiers |
| 5 | SHA-1 hash of a name | Like v3, preferred over it |
| 6 | Reordered v1 timestamp | Migrating sortable v1 data |
| 7 | Unix time in ms plus random bits | Database primary keys |
| 8 | Custom layout | Vendor specific schemes |
Will a UUID ever collide?
For practical purposes, no. With 122 random bits, you would need to generate about 2.7 quintillion v4 UUIDs before the chance of a single duplicate reaches 50 percent. At a billion per second that takes around 85 years. Real collisions come from broken random number generators, not from the math, which is why this tool uses the browser cryptographic generator and not Math.random.
To validate a UUID in code, the pattern ^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ with case insensitive matching accepts any standard version.
How to use it
- Choose the version: v4 for pure randomness, v7 when the values become primary keys.
- Set how many you need.
- Copy the list, with or without hyphens, in the letter case you prefer.
Frequently asked questions
v4 or v7 for a database key?
v7. Random v4 keys scatter inserts across the whole index, fragmenting it and hurting write performance. v7 values increase over time, so inserts land at the end of the index like an auto-increment column, while staying globally unique.
Can two UUIDs collide?
A v4 UUID has 122 random bits. You would need to generate billions per second for a century before a collision became likely. In practice the risk is a bug in a weak random source, not the mathematics, which is why this uses the browser crypto API.