Home › UUID Generator

UUID Generator

Create unique identifiers for database rows, files or test data: random version 4 or time-ordered version 7, one or many at a time.

Results

How it works

A UUID is 128 bits written as 32 hexadecimal digits in five groups. Version 4 fills 122 of those bits with cryptographically secure random numbers from your browser. Version 7 puts the current time in milliseconds in the first 48 bits, followed by random bits, so values sort roughly in creation order.

Rules and details

Worked example

A version 4 UUID such as 3f2a9c10-7b5e-4d21-a866-1cd490e30b57 has 36 characters including hyphens; its 13th digit is 4 and its 17th is a. The tool generates fresh random values every time you press the button, so this one is only an illustration.

Frequently asked questions

Can two UUIDs ever collide?

In theory yes, in practice no: with 122 random bits you would need to generate billions of values per second for many years to have a realistic chance of a duplicate.

Which version should I use for a database key?

Version 7 is friendlier to database indexes because new values are larger than old ones, which avoids scattering inserts. Version 4 is fine when order does not matter.

Are these UUIDs safe to use as secrets?

They come from a secure random source but they are identifiers, not authentication tokens. For secrets, use the token generator with a longer length.

Tips

Related tools

All tools