Definition
RFC 9562 is the IETF standard document that defines Universally Unique Identifiers (UUIDs). Published in May 2024, it obsoletes RFC 4122 (2005) and is the authoritative specification for all UUID versions used in software today.
The full text is available at rfc-editor.org/rfc/rfc9562.
What changed from RFC 4122
RFC 4122 defined UUID versions 1–5. RFC 9562 adds:
| Addition | Description |
|---|---|
| UUID v6 | Reordered v1 timestamp — lexicographically sortable v1 bridge |
| UUID v7 | 48-bit Unix ms timestamp + 74 bits random — the new default for database keys |
| UUID v8 | Custom layout — 122 bits application-defined, version/variant fixed |
| Max UUID | ffffffff-ffff-ffff-ffff-ffffffffffff — complement of the Nil UUID |
| v1 deprecated | UUID v1 exposes MAC addresses; v7 supersedes it |
| v2 deprecated | UUID v2 (DCE Security) deprecated for new work |
Unchanged: 128-bit format, 8-4-4-4-12 hex string, v3 (MD5 name-based), v4 (random), v5 (SHA-1 name-based), Nil UUID (00000000-0000-0000-0000-000000000000).
UUID v7 — the key addition
UUID v7 is the primary reason most developers care about RFC 9562. Its bit layout:
Bits 0–47: unix_ts_ms — Unix time in milliseconds (48 bits)
Bits 48–51: version — 0111 = "7"
Bits 52–63: rand_a — counter or random (12 bits)
Bits 64–65: variant — 10
Bits 66–127: rand_b — cryptographically random (62 bits)
The timestamp-first layout means UUID v7 values sort chronologically as plain strings — ORDER BY id gives creation-time order. This eliminates the B-tree fragmentation caused by UUID v4’s random distribution. See UUID v4 vs v7 and UUID Byte Layout.
Native platform support (post RFC 9562)
| Platform | UUID v7 support | Since |
|---|---|---|
| PostgreSQL | uuidv7() built-in | v18 (Sep 2025) |
| Python | uuid.uuid7() stdlib | 3.13 (Oct 2024) |
| .NET | Guid.CreateVersion7() | .NET 9 (Nov 2024) |
| Deno | @std/uuid v7.generate() | Deno 1.x |
For library support: uuid npm package, uuid-creator Java, uuid6 Python backport.
The Max UUID
RFC 9562 formalises ffffffff-ffff-ffff-ffff-ffffffffffff — all 128 bits set to 1 — as the Max UUID. It is the complement of the Nil UUID (00000000...) and useful as an upper bound sentinel in range queries and pagination cursors. See Max UUID.
Monotonic counter recommendation
RFC 9562 §6.2 defines two methods for within-millisecond ordering in UUID v7:
- Method 1 (recommended): a monotonic counter in the
rand_afield, incremented for each UUID in the same millisecond — guarantees strict ordering within a node - Method 2: fixed random
rand_awith random increment — probabilistic ordering
See Monotonic Counter for the implementation detail.
Related terms
- UUID v7 — the primary new version in RFC 9562
- UUID Versions — all eight versions compared
- Max UUID — the all-ones sentinel
- Monotonic Counter — within-ms ordering
- Time-Based UUID — v1, v6, and v7 compared
External references
- RFC 9562 — full text
- RFC 4122 — superseded standard
- Wikipedia — UUID
- RFC 9562 replaces RFC 4122 — what changed in detail
Frequently asked questions
What is RFC 9562 and when was it published?
RFC 9562 is the IETF standard that defines Universally Unique Identifiers (UUIDs). It was published in May 2024, replacing RFC 4122 (2005). The key additions are UUID v6 (reordered v1), UUID v7 (Unix millisecond timestamp), UUID v8 (custom application layout), the Max UUID sentinel, and explicit deprecation of v1 and v2. The 128-bit format, hyphen-separated hex string representation, and v3/v4/v5 semantics are unchanged.
Does RFC 9562 change UUID v4?
No. UUID v4 semantics are identical in RFC 9562 and RFC 4122 — 122 bits of CSPRNG randomness, 4-bit version field set to 0100, 2-bit variant set to 10. The only change is that RFC 9562 provides a more precise definition of "cryptographically random" and references modern CSPRNG requirements. Existing UUID v4 values and generators remain fully compliant. See All UUID Versions.