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 v1 | UUID v4 | |
|---|---|---|
| Time basis | 100 ns timestamp + clock seq | No time, 122 random bits |
| String sort follows time? | No, low bits first | No, random order |
| Contains MAC? | Traditionally yes | Never |
| Privacy | Leaks time and node | Opaque, nothing leaks |
| Modern replacement | v7 for sortable time | Still the default random choice |
| Collision source | Clock or node reuse | Random chance only (negligible) |
| Spec | RFC 9562 v1 legacy | RFC 9562 v4 current |
| Where it runs | Browser, no upload | Browser, no upload |
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.
For new work, v4 is the conservative random choice and v7 is the sortable time-based choice. Reserve v1 for legacy reads where you already have v1 values. If a legacy system emits v1 but you need chronological string sorting, migrate new columns to v7 rather than staying on v1.