Security Tools

UUID Generator

Generate UUID v4 or time-sortable UUID v7 identifiers instantly - 128-bit unique identifiers formatted as the standard 8-4-4-4-12 hex string, suitable for database keys, session tokens, and distributed systems.

UUID v4 vs v7 vs GUID

All three are the same 128-bit identifier in the same 8-4-4-4-12 format. What differs is how the bits are filled - and that decides how well they behave as a database key.

UUID v4UUID v7GUID
What fills it122 random bits48-bit timestamp + 74 random bitsMicrosoft’s name for the same standard
Sortable by timeNoYes, to the millisecondDepends on version
Database index behaviourRandom inserts fragment the indexInserts append, like an auto-increment keyAs per its version
Leaks creation timeNoYes - the timestamp is readableDepends on version
Typical usePublic IDs, tokens, anything where unpredictability mattersPrimary keys, event logs, anything inserted in volume.NET and Windows APIs

The practical rule: use v7 for database primary keys, and v4 when the identifier is exposed publicly and its creation time should stay private.

How likely is a UUID collision?

A version 4 UUID has 122 random bits, giving about 5.3 × 1036 possible values. The risk grows with the square of how many you generate, so it is small but not negligible at extreme volumes: generating a billion UUIDs a second for a century (about 3.16 × 1018 UUIDs) works out to roughly a 61% chance of at least one collision somewhere in that set. For virtually any real application - even one issuing millions of IDs - the probability is astronomically small; problems in practice come from a broken random source, never from exhausting the space, which is why the generator above uses the browser’s cryptographic crypto.getRandomValues rather than Math.random.

Reading a UUID

PositionCharactersMeaning
Overall3632 hex digits plus 4 hyphens
Group pattern8-4-4-4-12The canonical hyphenated form
15th character1The version digit - 4 for random, 7 for time-sortable
20th character1The variant - 8, 9, a or b for the RFC 9562 layout

What is a UUID?

A UUID is a 128-bit identifier written as 36 characters in the pattern 8-4-4-4-12, such as 3f2b8c1e-4a5d-4e7f-9b0a-1c2d3e4f5a6b. UUIDs are generated independently with no central coordinator, and the space is large enough that random v4 collisions are not a practical concern.

What is the difference between UUID v4 and v7?

UUID v4 is fully random, which makes it unpredictable but poorly ordered - random inserts fragment database indexes. UUID v7 puts a millisecond timestamp in the leading bits, so v7 values sort chronologically and index far better, while keeping enough randomness to stay unguessable.

Is a GUID the same as a UUID?

Yes, in practice. GUID is Microsoft's name for the same 128-bit identifier standard that everyone else calls a UUID, and the two are interchangeable in format and length. GUIDs are sometimes displayed wrapped in braces, but the underlying value is identical.

Runs in your browser. Your files and text never leave your device - nothing is uploaded.