UUID generator

Generate UUIDs with your browser's secure random number generator. Choose v4 for random IDs or v7 for IDs that sort by creation time.

Version

UUID v4 or v7?

v4v7
Built from122 random bits48-bit Unix time in ms + 74 random bits
Sort orderRandomBy creation time
Best forTokens, public IDs where order leaks nothingDatabase primary keys: inserts stay in index order

v7 was standardised in RFC 9562 (2024). Because new values sort after old ones, it avoids the index fragmentation that random v4 keys cause in databases such as PostgreSQL and MySQL. Note that a v7 UUID reveals when it was created.

UUID vs GUID

They are the same thing. GUID is Microsoft's name, often written in uppercase and wrapped in braces: {3F2504E0-4F89-41D3-9A0C-0305E82C3301}.

Can two UUIDs collide?

In practice, no. With 122 random bits you would need to generate about a billion v4 UUIDs a second for 85 years to have a 50% chance of one duplicate.

Generate a UUID in code

JavaScript  crypto.randomUUID()
Python      import uuid; uuid.uuid4()   (uuid.uuid7() in 3.14+)
PostgreSQL  gen_random_uuid()           (uuidv7() in 18+)
Bash        uuidgen
C#          Guid.NewGuid()   (Guid.CreateVersion7() in .NET 9+)

Frequently asked questions

Are these UUIDs random and safe to use?
Yes. They use the browser's cryptographically secure random generator (crypto.randomUUID and crypto.getRandomValues), and are generated on your device.
How many UUIDs can I generate at once?
Up to 1,000. Copy them or download them as a text file.
How do I check which version a UUID is?
Paste it into 'Check a UUID'. The version is the first digit of the third group: 4 in xxxxxxxx-xxxx-4xxx-…
Should I use v7 for database keys?
Usually, yes, if you are happy for the ID to reveal its creation time. It keeps B-tree indexes compact because new keys are always added at the end.