UUID v7 Generator
Generate UUID v7 — time-ordered UUIDs (48-bit timestamp ms + random). Ideal as primary key in databases. Everything in your browser.
UUID v7: the time-ordered UUID
UUID version 7 was standardised in RFC 9562 in May 2024, the successor to RFC 4122. It keeps the same 128-bit footprint and the familiar 8-4-4-4-12 hexadecimal layout as UUID v4, but the first half of the value is no longer random — it carries a Unix millisecond timestamp, so newer IDs sort after older ones.
Bit layout
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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
That is 48 bits of unix_ts_ms, 4 bits of version (0111 = 7), 12 bits of rand_a (random or sub-millisecond entropy), 2 bits of variant, and 62 bits of rand_b. Total entropy after the timestamp: 74 random bits — comfortably collision-resistant.
Why use v7 over v4
Random UUIDs scatter writes across the entire index, so each insert touches a cold page. Time-ordered UUIDs append to the rightmost leaf — fewer page splits, better cache locality, smaller WAL volume. Published Postgres benchmarks show v7 inserts roughly 40% faster than v4 on tables with tens of millions of rows. Debugging is easier too: you can read the creation time straight out of the prefix.
The UUID version family
- v1 — timestamp + MAC address. Leaks hardware identity.
- v3 / v5 — deterministic, derived from namespace + name (MD5 / SHA-1).
- v4 — random. The golden standard before v7.
- v6 — v1 rebuilt for lexicographic sort.
- v7 — millisecond timestamp + randomness. Recommended for new IDs.
- v8 — fully custom layout, vendor-defined.
Watch out for clock skew
In distributed systems, two nodes generating in the same millisecond can produce IDs that are very close but not strictly monotonic. RFC 9562 suggests two mitigations: keep a monotonic per-process counter, or fill rand_a with sub-millisecond entropy so collisions inside a tick are still resolved by sort order.
Generate time-sortable v7 UUIDs
For anyone working with databases, the v7 UUID is the natural successor to the unique identifier. It stores a timestamp right at the start, so the IDs come out already ordered by creation time. This tool generates valid v7 UUIDs on demand.
The edge over the fully random v4 jumps out when you use it as a primary key. Because v7 grows in sequence over time, database indexes stay much leaner, without the scattering v4 causes. You combine the UUID's uniqueness with the ordering of an auto-increment.
Generation leans on the browser's randomness and runs locally, sending no identifier to any server. Generate a single one or several at once, then copy them.
Frequently asked questions
Can I migrate from v4 to v7 in the same column?
Is v7 globally unique?
Can I recover the timestamp?
Related Tools
NFe Key Generator
Generate structurally valid 44-digit NFe access keys (mod-11 DV) for software testing. For test environments only.
IBAN Bank Account Generator (fake, PT)
Generate fake IBAN account numbers in PT format. Test data only — not real accounts.
Multi-type Pix Key Generator
Generate random Pix keys of 4 types: CPF, email, cellphone or EVP (UUID v4). For diverse test data.
Bank Receipt Mockup Generator
Generate fake bank transfer/Pix/TED receipt text. For UI testing — NEVER use in real transactions.
NanoID / ULID Generator
Generate modern unique identifiers: NanoID (URL-safe, 21 chars by default) and ULID (time-sortable, 26 chars). Compact UUID alternatives for modern databases. Processed in the browser.
UUID Generator
Generate random UUID v4 identifiers with one click. Copy individually or in bulk. Processed in the browser, no data sent to servers.