UUID v7 v7 · time-sortable
The latest UUID, storing Unix milliseconds in the first 48 bits so it sorts chronologically.
Overview
It appends random bits after the timestamp to satisfy both uniqueness and ordering. It is the latest version standardized in RFC 9562.
Structure
| Bit length | 128 |
|---|---|
| Character length | 36 |
| Format | hex 8-4-4-4-12 |
| Sortable | Yes |
| Random-based | Partial |
When to use
Especially useful where insertion-order sorting matters, such as database primary keys and indexes. Recommended as the default choice for new systems.