UUID v6/v7 Generator

Create sortable UUIDs that embed timestamp information for indexes that prefer ascending insert order over random v4 scatter.

Result

Ready.

Time-ordered IDs for modern schemas

Random UUID v4 spreads inserts across index leaf pages, which can fragment storage on high-write tables. v6/v7 trade a little predictability for locality—often worth it in event logs and ledger rows.

Clock dependency

Timestamp components reflect generator clock time. NTP drift across nodes is usually minor, but never use client-generated ordered UUIDs as sole proof of event ordering in distributed audits.

Interop with string APIs

Most services accept canonical 8-4-4-4-12 lowercase hex with hyphens. Store consistently—mixing uppercase in URLs can break case-sensitive caches.

FAQ

What is the difference between UUID v6 and v7?
Both improve monotonic sortability versus v4. v7 is the newer time-ordered RFC draft widely adopted in 2024+ stacks; v6 rearranges timestamp fields for compatibility with older ordered-UUID experiments.
Should I use these as database primary keys?
Time-ordered UUIDs reduce B-tree page splits compared to random v4. Still index consciously on Postgres, MySQL, or SQLite—binary storage can save space versus char(36).
Are generated IDs guaranteed unique?
Collision risk is negligible for practical workloads, but distributed systems should still enforce unique constraints and handle rare insert conflicts idempotently.