What Is a UUID, and What Makes Version 4 Special?
A UUID (Universally Unique Identifier) is a 128-bit value used to identify something - a record, a device, a session - without needing a central authority to hand out IDs one at a time. Any system, anywhere, offline or online, can generate its own UUID and be confident it won't collide with one generated independently by anyone else.
Version 4 is the random variant, and the one most tools (including this one) generate by default. Of its 128 bits, 122 are chosen using a cryptographically secure random number generator, while the remaining 6 bits are fixed to mark the UUID's version and variant - which is why every v4 UUID has a 4 as the first character of its third group, and an 8, 9, a, or b as the first character of its fourth group.
Because those 122 bits are random rather than sequential, collision probability is astronomically low: with roughly 5.3 x 10^36 possible values, you would need to generate billions of UUIDs per second for decades before the odds of a single accidental collision became meaningful.
UUID vs GUID - What's the Difference?
| Term | Origin | Format |
|---|---|---|
| UUID | Universally Unique Identifier - defined in RFC 4122, used across most languages and platforms | 128-bit value, same layout as GUID |
| GUID | Globally Unique Identifier - Microsoft's own name for the same concept, used throughout .NET, Windows, and SQL Server | 128-bit value, same layout as UUID |
There is no technical difference between the two - a GUID is a UUID. The distinction is purely naming convention: "GUID" is the term Microsoft's ecosystem settled on decades ago, while "UUID" is the name used by the underlying RFC standard and most other languages and platforms. You can use values generated here anywhere a GUID is expected.
Common Use Cases
Frequently Asked Questions
Version 1 encodes a timestamp and the generating machine's MAC address instead of pure randomness, which makes it sortable and traceable to its origin but leaks device and timing information. Versions 3 and 5 are deterministic - they hash a namespace and a name together (MD5 for v3, SHA-1 for v5), so the same input always produces the exact same UUID every time. Version 7, a newer addition to the standard, embeds a Unix millisecond timestamp in its high bits so UUIDs sort roughly in creation order while still including random bits for collision resistance, combining v4's randomness with v1's sortability.
Those 6 fixed bits let any system that receives a UUID immediately tell which version and variant scheme produced it, without ambiguity. That matters for interoperability: it's how software can distinguish a time-based v1 identifier from a random v4 one, or recognize an RFC 4122-compliant UUID at all, rather than treating it as just an arbitrary 128-bit number with no defined structure to interpret.
Generally yes for the enumeration problem - the 122 bits of randomness make a v4 UUID effectively unguessable, so unlike a sequential integer ID it doesn't reveal how many records exist or let someone walk through them by incrementing a number. It isn't a secret credential, though: anyone who is handed or discovers a specific UUID can act as if they know it, so it still needs to be paired with real authorization checks rather than relying on its unguessability alone to control access.
They work well when you need IDs generated without coordination, such as by multiple services or offline clients, since collisions are effectively impossible. The trade-off is that random UUIDs are larger than integers and don't sort sequentially, which can fragment index performance on very large tables - some systems use time-ordered variants like UUID v7 to address this.
No, as long as it was generated with a cryptographically secure random number generator, as this tool and modern crypto.randomUUID() implementations do. The 122 random bits make brute-force guessing computationally infeasible, though a UUID should still not be treated as a secret credential on its own.