UUID v7 Generator

Time-ordered UUIDs from RFC 9562 — sortable by creation time, ideal as database primary keys.

What is UUID v7?

UUID v7 starts with a 48-bit Unix-epoch millisecond timestamp followed by random bits. IDs generated later always sort after IDs generated earlier, while remaining unpredictable enough for most use cases.

Why use v7 for database keys?

Purely random v4 keys scatter inserts across a B-tree index, causing page splits and cache misses at scale. v7 keys are naturally append-mostly like auto-increment integers, keeping indexes compact — while still being globally unique and generatable by any client without coordination.

v7 vs ULID?

ULID solves the same problem with a different text encoding (Crockford base32). UUID v7 has the advantage of being a standard UUID: it fits every existing uuid column type, driver, and library. If your stack speaks UUID, v7 is the natural choice.

Need a different version? Try the full UUID generator supporting v1, v3, v4, v5 and v7.