UUID v7 · Timestamp · Sortable · RFC 9562
UUID v7 Timestamp: Generate and Understand
Updated: May 2026
UUID v7 is the modern recommended version for databases. Unlike the fully random UUID v4, UUID v7 encodes the Unix millisecond timestamp in its first bits, making it naturally sorted by creation order.
Free · No upload · Generated in the browser
UUID v7 structure
UUID v7 is defined in RFC 9562 (2024). Its layout:
0192f6a4-1234-7xxx-yxxx-xxxxxxxxxxxx
│ 48 bits │ ver │ 12 bits │ var │ 62 bits │
timestamp rand rand
- Bits 0–47: Unix timestamp in milliseconds (big-endian).
- Bits 48–51: version =
7. - Bits 52–63: counter or sub-millisecond random bits.
- Bits 64–65: variant =
10(RFC 4122). - Bits 66–127: random bits.
Database performance advantage
Databases like PostgreSQL, MySQL and SQLite index data in B-tree structures. Inserting UUID v4 (random) fragments the index since each insertion can land anywhere in the tree, causing frequent page rewrites.
With UUID v7, each new identifier is greater than the previous one (same or later timestamp), producing sequential insertions at the end of the index. Result: less fragmentation, better cache locality, faster inserts.
Extracting the timestamp from UUID v7
uuid = "0192f6a4-1234-7abc-9def-0123456789ab"
ts_hex = "0192f6a41234" // first 12 chars (no dashes)
ms = parseInt(ts_hex, 16) // → 1747820716596
date = new Date(ms).toISOString() // → "2025-05-21T..."
The Flowfiles Validate tool extracts and displays this date automatically for each detected UUID v7.
Frequently asked questions
Is UUID v7 standardized?
Yes. UUID v7 is defined in RFC 9562 published in May 2024, which replaces and extends RFC 4122.
Is UUID v7 supported by frameworks?
Increasingly. Laravel 11+, Ruby on Rails 7.1+, Java UUID Creator, Go google/uuid v1.6+ support UUID v7 natively.
Is UUID v7 sorted correctly in SQL?
Yes, if the column type is UUID or CHAR(36) and sorting is alphabetical (default). The lowercase hex format of UUID v7 is correctly sorted lexicographically.