UUID v1 vs v4 — Which Should You Use?

v1 and v4 look identical on the surface, both are 36-character strings, but they generate those bits very differently. v1 embeds a timestamp, clock sequence, and MAC-derived node, so time is in the bits but not in sort order. v4 is pure randomness, opaque and private. One leaks hardware identity and arrival order, the other hides it. Both generate locally in your browser.

Use v1 when

  • You must interoperate with a legacy system that already stores v1 and expects it.
  • You need to extract a creation timestamp from an old v1 value for auditing.
  • You are reading existing data, not designing a new ID scheme.
  • You have no choice: the spec or database already hard-codes v1.

Use v4 when

  • You are generating new IDs and want no time or hardware leakage.
  • You want the simplest secure default with the widest library support.
  • You need opaque IDs for tokens, sessions, or public keys.
  • You do not need sortability. If you do, v7 is the modern time-ordered choice, not v1.

Side by side

UUID v1UUID v4
Time basis100 ns timestamp + clock seqNo time, 122 random bits
String sort follows time?No, low bits firstNo, random order
Contains MAC?Traditionally yesNever
PrivacyLeaks time and nodeOpaque, nothing leaks
Modern replacementv7 for sortable timeStill the default random choice
Collision sourceClock or node reuseRandom chance only (negligible)
SpecRFC 9562 v1 legacyRFC 9562 v4 current
Where it runsBrowser, no uploadBrowser, no upload
under the hood

This generator supports v1 for completeness, but new projects should prefer v7 when they want time ordering and v4 when they want opaque randomness. Neither tool uploads your IDs; both run entirely in the browser.