2026-08-07
UUID v4 vs v1: which should you use?
Compare random UUID v4 with time-based v1. Prefer v4 for most new IDs unless you need time ordering.
UUID v1 and UUID v4 both produce 128-bit identifiers in the same string layout, but they encode very different information. Choosing the wrong version can leak machine details or surprise you with time-based ordering (or the lack of it).
UUID v4 - random
Version 4 fills most bits with randomness. There is no embedded timestamp or MAC address. That makes v4 the usual default for opaque IDs: primary keys, request IDs, and client-minted records when you do not need chronological sorting from the ID itself.
UUID v1 - time-based
Version 1 combines a timestamp with a clock sequence and a node identifier (historically a MAC address). v1 IDs tend to sort roughly by creation time, which can help some indexes, but they can also reveal when (and sometimes where) they were created. Many environments now use randomized node bits, yet the time component remains.
Quick comparison
- Prefer v4 when you want opaque, random IDs without time or hardware hints.
- Consider v1 (or modern time-sortable alternatives) only when you explicitly need creation-time ordering in the identifier.
- Collisions: both are designed for practical uniqueness; v4 relies on randomness at scale, v1 on the timestamp/node construction.
What about UUID v7?
Newer specs such as UUID v7 aim for time-sortable IDs with a cleaner layout than classic v1. Jigglify's generator focuses on everyday v4 needs. If you need sortable keys, evaluate ULID/UUID v7 in your stack - and keep using v4 when opacity matters more than order.
Generate random UUID v4 IDs free in your browser - bulk copy supported.
Open the free UUID generator →
Related: What is a UUID? · How to generate UUID v4