UUID v7 Generator — Time-Ordered UUIDs for Databases
Generate v1, v3, v4, v5, v6, v7 UUIDs · Bulk export · Validate · Inspect · Batch check
UUID v7 embeds the current Unix millisecond timestamp in the first 48 bits, making it lexicographically sortable — new UUIDs always sort after older ones. This eliminates B-tree index fragmentation common with random UUIDs, making v7 the modern recommended choice for database primary keys. RFC 9562 compliant.
26f8fb34-1171-4d5d-8494-19da97e9e844
Frequently Asked Questions
How is UUID v7 different from v4 for databases?
UUID v4 is entirely random — when used as a primary key, each INSERT goes to a random position in the B-tree index, causing frequent page splits and up to 90% index fragmentation. UUID v7 embeds the current Unix millisecond timestamp in the first 48 bits, so new UUIDs always have higher values than old ones — they append to the end of the index like auto-increment IDs, eliminating fragmentation.
What does the structure of UUID v7 look like?
UUID v7 has this structure: [48-bit Unix timestamp ms][4-bit version=7][12-bit random][2-bit variant][62-bit random]. The first 12 hex characters encode the Unix timestamp in milliseconds. For example, 018e8a3f-1d2c-7abc-8def-1a2b3c4d5e6f encodes the timestamp in 018e8a3f1d2c — use the UUID Inspector to decode the exact date.
Is UUID v7 standardised?
Yes — UUID v7 is defined in RFC 9562 published by IETF in May 2024, which supersedes RFC 4122. It is now part of the official UUID standard alongside v1 through v8. Most modern UUID libraries support v7 — npm uuid@9+, Python uuid (3.12+), and Rust uuid crate all include v7 support.
Which databases support UUID v7 natively?
PostgreSQL 16+ supports gen_random_uuid() for v4 but not v7 natively — use uuid-ossp extension or generate v7 in application code. MySQL 8.0+ has UUID() for v1. For v7, the recommended approach is to generate in application code (using this tool for testing, or a library in production) and store as BINARY(16) or CHAR(36).
Can UUID v7 be decoded to find when it was created?
Yes — UUID v7 encodes the Unix millisecond timestamp in the first 48 bits. Use the UUID Inspector (Inspect tab) in this tool to paste any v7 UUID and see the exact creation date and time decoded from the embedded timestamp. This is useful for debugging and audit trails.
What is UUID v6 and how does it differ from v7?
UUID v6 is a reordered version of v1 — it rearranges the Gregorian timestamp bits (100-nanosecond precision since 1582) to be lexicographically sortable. UUID v7 uses Unix epoch milliseconds (since 1970). v7 is generally preferred for new systems as the Unix epoch is more familiar to developers and millisecond precision is sufficient for most applications.