UUID v4
What this is
v4 is 122 bits of randomness plus version/variant bits. It is the default for database keys, request ids, and idempotency keys. Collision risk is negligible for normal app volumes. Use crypto.randomUUID() — never Math.random().
Open the generator — v4, v7, and v5 in this tab.
FAQ
- Sortable?
- No. v4 does not increase with time. If you need time-ordered ids for B-tree indexes, use v7.