UUID Generator
Create UUIDs for database keys, fixtures and test data — random v4 or sortable v7, up to 1,000 at a time. They come from your browser's cryptographic random number generator and are never sent to a server. The validator below decodes the version, variant and timestamp of UUIDs you already have.
Pick a version and count, then press Generate.
UUID validator
| UUID | Version | Variant | Created (UTC) |
|---|
UUID v4 vs v7: which should you use?
A UUID (universally unique identifier, also called a GUID) is a 128-bit ID that anyone can create without a central authority and still never collide in practice. The current standard is RFC 9562 (May 2024), which replaced RFC 4122 and added versions 6, 7 and 8.
| v4 | v7 | |
|---|---|---|
| Contents | 122 random bits | 48-bit Unix timestamp (ms) + 74 random bits |
| Sort order | None | Sorts by creation time |
| As a primary key | Random inserts fragment B-tree indexes | Appends to the end of the index — fast (recommended) |
| Leaks | Nothing | Creation time to the millisecond |
For new database tables, v7 is the better default; PostgreSQL 18 ships uuidv7() for the same reason. Use v4 where the creation time must stay private, such as invite links. Either way, a UUID is hard to guess but is not a secret — use a dedicated random token for authentication.
How to read a UUID
A UUID is 32 hex digits grouped 8-4-4-4-12, for example 017f22e2-79b0-7cc3-98c4-dc0c0c07398f.
- Version: the first digit of the third group (
7above). 1 and 6 are time-based, 3 and 5 are name hashes, 4 is random, 7 is Unix-time based. - Variant: the first digit of the fourth group.
8,9,aorbmeans a standard RFC 9562 UUID;cordis a legacy Microsoft GUID. - v7 timestamp: the first 12 hex digits are milliseconds since 1970. The example above was created on February 22, 2022 at 19:22:22 UTC. The validator decodes timestamps for v1, v6 and v7.
When several v7 UUIDs fall in the same millisecond, this generator uses a 12-bit counter (RFC 9562 §6.2, method 1) so creation order always equals sort order. Dropping them into a JSON fixture? Tidy it with the JSON formatter.
FAQ
Can two UUIDs ever be the same?
In theory, yes; in practice, no. With 122 random bits, even a billion v4 UUIDs have roughly a 10-19 chance of a single collision. v7 adds 74 random-or-counter bits to every millisecond.
Are the UUIDs logged on your server?
No. They are generated on your device with crypto.getRandomValues (and crypto.randomUUID for v4), and nothing is sent to a server or stored.
What's the difference between a GUID and a UUID?
None — GUID is Microsoft's name for the same thing. Windows and .NET often write them in uppercase inside braces ({…}), which you can turn on above.
Sources
- Universally Unique IDentifiers (UUIDs), including v4 and v7: RFC 9562
Found this useful? Share it
Only the page link is shared. Your inputs and files are never included.