What a UUID is
A UUID (Universally Unique Identifier, RFC 9562) is a 128-bit value written as 32 hex digits in five groups — 8-4-4-4-12. Its whole purpose is to let independent systems mint identifiers that won't collide without coordinating through a central database or counter.
The version digit says how the bits were chosen. v4 is almost entirely random — simple and unordered. v7 puts a 48-bit Unix-millisecond timestamp up front and fills the rest with randomness, so the IDs sort chronologically. That single property is why v7 has quickly become the recommended choice for database keys, replacing the old trick of a random v4.
Generation here uses the browser's secure random source and runs entirely on your device.
v4 vs. v7
122 random bits — unordered and dead simple. The classic general-purpose ID.
Timestamp prefix + randomness — sortable by creation, index-friendly.
Where developers use it
Primary keys
Mint a v7 ID for a new row so records stay roughly insert-ordered without a central sequence.
Tracing requests
Tag each request with a v4 correlation ID to follow it across services in your logs.
Idempotency
Send a UUID with a payment request so retries don't double-charge.
Frequently asked questions
Not guaranteed, but the odds of a collision are negligible. A v4 UUID has 122 random bits — you'd need to generate billions per second for decades to have a realistic chance of a duplicate. In practice they're treated as unique without a central authority handing them out.
Use v4 when you just need a random, unordered identifier. Use v7 when the UUID is a database primary key: its millisecond timestamp prefix makes it sortable by creation time, which keeps B-tree indexes from fragmenting the way random v4 keys do.
Because they're random, consecutive inserts land in random index positions, causing page splits and poor cache locality. Time-ordered v7 (or ULIDs) insert at the "end" of the index, which is far friendlier to most databases.
Yes. The first 48 bits of a v7 UUID are the Unix time in milliseconds, so the creation time can be read straight back out of the ID. That's by design — it's what makes v7 sortable. (v4 carries no timestamp, so nothing can be extracted from it.)
It's the all-zero UUID, 00000000-0000-0000-0000-000000000000 — a special value meaning "no UUID," similar to a null reference or a default/empty placeholder.
No. They're produced locally with the browser's cryptographically-secure random generator, so nothing is requested from or logged by a server.