UUID Generator

Generate v4 or time-sortable v7 UUIDs from a cryptographically secure source.

Between 1 and 500.

100 runs left today · sign up for more

About this tool

Generates UUIDs — random v4, or time-ordered v7 — using the operating system's secure random source rather than a general-purpose one.

That distinction matters more than it looks. An identifier from a predictable generator can be guessed, and anywhere an unguessable URL is doing security work — a password reset link, a shared document, an invitation — a guessable one is an access control failure.

Version 7 exists because v4 makes a poor database key. Random values scatter inserts across the whole index instead of appending to the end of it, which fragments the index and slows writes as a table grows. A v7 sorts by creation time and behaves like an auto-increment while staying unguessable.

Common questions

What is the difference between v4 and v7?

v4 is entirely random. v7 puts a millisecond timestamp in the leading bits and fills the rest with randomness, so v7s sort by creation time. Both are unguessable; only v7 is a sensible database key.

Can two UUIDs collide?

In principle. In practice a v4 has 122 random bits, and you would need to generate billions per second for decades before a collision became likely. It is not a risk worth engineering around.

Is a UUID safe to put in a URL?

From a guessing standpoint, yes, provided it came from a secure random source. But a URL is not a permission — it gets shared, logged and pasted into chat. Treat an unguessable URL as obscurity, not access control.

Why do people avoid UUIDs as primary keys?

Because v4 keys are random, so each insert lands anywhere in the index and fragments it, and they are 16 bytes against 8 for a bigint. v7 fixes the first problem, which was the expensive one.