Skip to content
codinganthem
All tools/Generators/UUID Generator

UUID Generator

Generate one or hundreds of random v4 UUIDs instantly online, for free. Perfect for database primary keys, session tokens, and API request IDs.

More
Buy me a coffee

What a UUID v4 is

A UUID is a 128-bit identifier written as 32 hex digits in five groups: 8-4-4-4-12. In version 4, 122 of those bits are random. The 13th digit is always 4 (the version) and the 17th is 8, 9, a or b (the variant), which is how you can tell a v4 UUID at a glance.

f47ac10b-58cc-4372-a567-0e02b2c3d479
              ^    ^
         version  variant

How unlikely is a collision?

With 122 random bits, you'd need to generate about 2.7 quintillion (2.7 × 10^18) UUIDs to have a 50% chance of a single duplicate. In practice, collisions only happen when the random number generator is broken. This tool uses the browser's cryptographic generator (crypto.randomUUID / crypto.getRandomValues), not Math.random.

UUID v4 vs v7 for database keys

Random v4 keys spread new rows across the whole index, which can slow inserts on large tables because the database keeps writing into different pages. UUID v7, standardised in RFC 9562 (2024), starts with a timestamp, so new keys sort roughly in creation order and index like an auto-increment. This tool generates v4, which is right for tokens, request ids and most keys; consider v7 if your database and library support it and insert speed matters.

Tips

  • Store UUIDs in a native uuid column (PostgreSQL) or as 16 bytes, not as a 36-character string, to save space.
  • UUIDs are case-insensitive. Lowercase is the standard form, so compare them case-insensitively.
  • A UUID is unique, not secret. Don't use one as the only protection on a private link if guessing it would matter; use a longer random token instead (Password Generator).

Frequently asked questions

Can two UUID v4s ever be the same?+

In theory yes, in practice no: you'd need about 2.7 × 10^18 UUIDs for a 50% chance of one duplicate, as long as a cryptographic random generator is used.

What's the difference between UUID and GUID?+

They're the same thing. GUID is Microsoft's name for a UUID; the format is identical.

Should I use UUID v4 or v7?+

v4 is fully random and fine for most ids and tokens. v7 starts with a timestamp, so it sorts by creation time and indexes better as a database primary key.

How many UUIDs can I generate at once?+

Up to 100 at a time, and you can copy them all with one click.