UUID Generator — v4 and v7

Generate one or hundreds of UUIDs. Version 4 is fully random; version 7 is ordered by creation time.

UUIDs
Ready

What is a UUID?

A UUID (Universally Unique Identifier), called a GUID in Microsoft ecosystems, is a 128-bit ID written as 32 hexadecimal digits in five groups: 8-4-4-4-12, for example 3f2b8c1e-9d4a-4e7b-b1c2-5a6f7e8d9c0b. UUIDs let separate systems create IDs independently — on different servers, phones or browsers — without asking a central database for the next number, and without realistic risk of two being the same.

UUID v4 vs v7

Version 4Version 7
Built from122 random bits48-bit Unix timestamp (ms) + 74 random bits
Sort orderRandomSorts by creation time
Database indexesInserts scatter across the indexInserts append near the end — faster and smaller
Reveals creation timeNoYes, to the millisecond
Best forTokens, public IDs, anything that should not leak timingPrimary keys, event IDs, logs

Version 7 was standardised in RFC 9562 (2024), which replaced the original RFC 4122. It is now the recommended choice for database primary keys in PostgreSQL, MySQL and similar systems, because time-ordered keys keep B-tree indexes compact.

How unique is "unique"?

A v4 UUID has 2122 possible values, about 5.3 × 1036. You would need to generate roughly 2.7 quintillion (2.7 × 1018) of them before there is even a 50% chance of a single duplicate. In practice, collisions only happen when the random number generator is broken. This tool uses crypto.getRandomValues, the browser's cryptographically secure source, for every UUID.

Formats

UUIDs are generated in your browser and never sent to a server.

Frequently asked questions

Is a GUID the same as a UUID?
Yes. GUID is Microsoft's name for the same 128-bit identifier format. A UUID with uppercase letters and braces is the usual GUID presentation.
Should I use UUID v4 or v7 for database keys?
v7 is usually better for primary keys because new values sort after old ones, which keeps indexes efficient. Use v4 when the ID must not reveal when it was created.
Can two generated UUIDs ever be the same?
In theory yes, in practice no. With 122 random bits, the chance of a duplicate is negligible even across billions of IDs.
Are UUIDs secure tokens?
Random v4 UUIDs are unpredictable when generated with a secure random source, as here, but dedicated tokens with more randomness are better for secrets such as password-reset links. Never use v7 as a secret, because part of it is a timestamp.

Related tools

Password Generator, Hash Generator, JSON Formatter, JWT Decoder.