Generate random UUID (v4) / GUID values instantly.
A universally unique identifier is a 128-bit value written as 32 hexadecimal digits in five hyphen-separated groups. Its purpose is to let independent systems create identifiers that will not collide without any central coordination — no sequence server, no locking, no negotiation.
This generator produces version 4 UUIDs, which are random. Of the 128 bits, 6 are fixed to identify the version and variant, leaving 122 bits of randomness.
No, provided the randomness is good. There are 2^122 possible v4 UUIDs, roughly 5.3 x 10^36. To reach a 50% chance of a single collision you would need to generate about 2.7 x 10^18 of them. Generating a billion UUIDs per second, that is on the order of 85 years — and even then the probability of any given pair colliding remains vanishingly small.
The practical risk is not the mathematics but the source of randomness. This tool uses the browser's crypto.getRandomValues(), a cryptographically secure generator. Implementations built on Math.random() are not secure, may have far less entropy than advertised, and have produced real collisions in the wild.
| Version | Based on | Sortable | Notes |
|---|---|---|---|
| v1 | Timestamp + MAC address | Partly | Leaks the machine's MAC and creation time |
| v3 | MD5 of a namespace + name | No | Deterministic; same input gives same UUID |
| v4 | Random | No | The general-purpose default |
| v5 | SHA-1 of a namespace + name | No | Deterministic; preferred over v3 |
| v7 | Unix timestamp + random | Yes | Time-ordered; good for database keys |
Version 4 is the right default when you simply need a unique identifier. Versions 3 and 5 are useful when the same input must always produce the same identifier — deriving a stable ID from a URL, for instance. Version 7, standardised in 2024, is worth knowing about: it puts a millisecond timestamp in the high bits so the values sort chronologically, which solves the database problem described below.
Using v4 UUIDs as primary keys has a real cost that is easy to miss until a table grows large.
The advantages are equally real: identifiers can be generated client-side before an insert, merging data from separate systems needs no remapping, and sequential integers do not leak how many records exist or let anyone enumerate them. If you need both, use v7, or store the UUID as a native 16-byte type rather than a 36-character string — the latter nearly doubles the storage and slows every comparison.
In a valid v4 UUID the 13th hex digit is always 4, marking the version, and the 17th is one of 8, 9, a or b, marking the RFC 4122 variant. In the example above, the 4 in 4372 and the a in a567 are those markers. It is a quick way to sanity-check that a string is a genuine v4 UUID rather than arbitrary hex.
UUIDs are case-insensitive; lowercase is conventional. The hyphens are part of the canonical form but some systems store the 32 digits without them, and a few wrap the whole thing in braces.
A UUID is an identifier, not a credential. A v4 UUID is unguessable in practice, which sometimes tempts people to use one as a password reset token or an unauthenticated access link. That is workable only if the value is generated from a secure random source, transmitted over HTTPS, given a short expiry and invalidated after use. Versions 1, 3, 5 and 7 are all partly predictable and must never be used this way.
In theory yes, in practice no. With 122 random bits, reaching a 50% chance of one collision requires around 2.7 quintillion UUIDs. The realistic risk comes from a weak random number generator, not from the odds — which is why a cryptographically secure source matters.
Version 4 for general-purpose unique identifiers. Version 5 when the same input must always produce the same identifier. Version 7 when you want time-ordered values that index well as database primary keys.
Random v4 UUIDs cause index fragmentation on write-heavy tables because inserts land at arbitrary positions in the B-tree. Version 7 solves this by making values time-ordered. Also store them as a 16-byte native type rather than a 36-character string.
A v4 UUID from a cryptographically secure generator is unguessable, so it can work for short-lived, single-use links over HTTPS. Other versions encode timestamps or hashes and are partly predictable, so they must never be used as secrets.
No. They are generated in your browser using crypto.getRandomValues(). Nothing is transmitted, so no one else — including us — ever sees the values you produce here.