UUID generator

Generate random v4 or time-ordered v7 UUIDs, one or up to a thousand at once.

How it works

A UUID is 128 bits written as 32 hex digits in groups of 8-4-4-4-12. In v4 122 bits are random; in v7 the first 48 bits are the Unix time in milliseconds and the rest is random. Both set the version digit (the 13th) and the variant bits.

Worked example

  1. v4: 3f1c9b7a-2d4e-4c1b-9a6f-8e2d5c7b1a03
  2. the “4” after the second dash is the version
  3. the 8, 9, a or b after the third dash is the variant

Frequently asked questions

Which version should I use, v4 or v7?

v4 is fully random and the usual choice. v7 starts with the current time in milliseconds, so new IDs sort after older ones; database indexes like that better.

Can two UUIDs ever be the same?

In practice no. A v4 UUID has 122 random bits; you would need to create about a billion per second for 85 years to reach a 50% chance of one duplicate.

Are these UUIDs safe to use?

They are created in your browser with crypto.getRandomValues, a cryptographically secure generator, and never leave your device.