← All Tools

UUIDv7 Generator & Inspector

UUID version 7 (RFC 9562) packs a big-endian Unix millisecond timestamp into the leading 48 bits so IDs sort naturally by creation time. Great for database indexes: no more random-uuid B-tree fragmentation, no separate created_at needed for coarse ordering, and still collision-safe thanks to 74 bits of entropy.

Single

Batch generate

Bit layout

128 bits total, rendered as 8-4-4-4-12 hex. The high 48 bits hold the timestamp (ms since 1970-01-01 UTC), followed by 4 bits fixed to 0111 (version 7), 12 bits of extra randomness (rand_a), 2 bits fixed to 10 (variant), and 62 bits of random rand_b. That means the first hex digit of the 3rd group is always 7, and the first hex digit of the 4th group is one of 8 9 a b.

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           unix_ts_ms                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          unix_ts_ms           |  ver  |       rand_a          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|var|                        rand_b                             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                            rand_b                             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

UUIDv4 vs UUIDv7 vs ULID

  v4 v7 ULID
Sortable by time✔ (ms)✔ (ms)
Bits of entropy1227480
Length (rendered)363626 (base32)
StandardisedRFC 9562RFC 9562Draft (Alizain 2016)
Drop-in for existing uuid columns✘ (needs base32)