GUID / UUID V6 - Reordered Time-Based Identifier (Sortable)

GUID / UUID v6 is a reordered time-based identifier designed to be lexicographically sortable by creation time. It is essentially v1 with the timestamp bytes reordered so that the most significant time bits come first, enabling simple string/byte comparisons for time-based sorting. This makes v6 ideal for database indexing and systems requiring time-ordered keys.

Modern time-based GUID / UUID: v6 provides improved v1 format with sortable structure and privacy-safe design. For new systems without v1 compatibility needs, consider v7, which uses Unix timestamps and is the recommended modern approach.

Version status and history

GUID / UUID v6 was proposed around 2021 as part of the GUID / UUID modernization efforts and standardized in RFC 9562 in May 2024.

V6 is fully supported in RFC 9562 and has no deprecation concerns. It addresses the sortability issues of v1 while maintaining field-level compatibility.

For new systems requiring time-based sortability, RFC 9562 recommends v7 (Unix timestamp-based) over v6, unless v1 compatibility or Gregorian timestamp semantics are required.

Advantages of GUID / UUID v6

  • Lexicographically sortable by time: values generated later generally sort after earlier ones without parsing fields, enabling efficient time-based queries.
  • Better database locality: reduced index fragmentation compared to fully random GUIDs / UUIDs in many common B-tree style indexes, improving write performance.
  • Field-compatible with v1: keeps the familiar concepts of Gregorian timestamp, clock sequence and node identifier while improving ordering.
  • No central coordination required: can be generated independently across machines and services without a central authority.
  • Good for distributed IDs with ordering: helps when you want IDs that roughly reflect creation order (logs, events, audit records).
  • Privacy-safe option: modern implementations use random node IDs instead of MAC addresses, avoiding hardware tracking concerns.
  • Easy validation: version nibble and variant bits provide quick sanity checks during parsing.

Warnings

  • Privacy risk if MAC-based node IDs are used: v6 can embed a hardware identifier (like v1). Prefer a random node ID if you don't want host tracking.
  • Not “secret” or unguessable: time-ordered IDs can leak creation timing patterns and may be more predictable than purely random IDs.
  • Ordering is “generally” time-based, not absolute: clock skew, clock adjustments or multi-node generation can still produce out-of-order values.
  • Implementation differences: how the clock sequence and node fields are initialized (random vs legacy behavior) can vary by implementation.
  • Collision handling depends on generator quality: a bad clock strategy, repeated state, VM cloning or a reused node/sequence combination can increase collision risk in flawed implementations.
  • Prefer v7 for new systems: RFC 9562 recommends GUID / UUID v7 for systems that don't need legacy v1 semantics, since v7 uses a Unix-time-based design and is commonly favored for modern DB keys.

Technical description

What fields exist: GUID / UUID v6 reuses the same building blocks as GUID / UUID v1: a 60-bit timestamp (Gregorian epoch, 100-nanosecond units), a clock sequence (used to help uniqueness when time doesn't strictly increase) and a 48-bit node identifier (traditionally a MAC address, but often randomized for privacy).

Ordering behavior: v6 is designed so the timestamp bytes appear from most significant to least significant early in the GUID / UUID. That means a straightforward lexical sort of the canonical string usually groups values in creation-time order (unlike v1, where time bits are split in a way that breaks simple sorting).

Version and variant in practice: the GUID / UUID version is encoded in the first hex digit of the third group (it will be 6 for v6). The most common layout variant used on the web and in RFC 9562 is the “DCE” variant, where the variant bits are 10xx in the relevant byte.

Try our GUID / UUID Inspector to see the structure of v6 GUIDs / UUIDs.

Format and structure

GUID / UUID v6 uses the standard 8-4-4-4-12 canonical format with 32 hexadecimal digits separated by hyphens (36 characters total).

Canonical format:  8-4-4-4-12
Example (v6):      1ec9414c-232a-6b00-b3c8-9c9b5f0a2b1d
Layout:            xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx
                                 ^    ^
                                 |    └─ N = Variant: is typically 8, 9, a or b (RFC variant)
                                 └────── M = Version: first hex digit of the 3rd group is "6" for v6
                

Practical rule: in the canonical string, the version is encoded as the first hex digit of the third group. For v6 it is 6. The variant is indicated by the high bits of the fourth group (often rendered as 8-b in hex). The timestamp bytes are ordered for lexicographical sorting.

Frequently Asked Questions

GUID / UUID v6 is a reordered version of v1 that reorganizes the timestamp bytes for lexicographical sorting. Both use a 60-bit Gregorian timestamp, 14-bit clock sequence and 48-bit node identifier. The key difference is that v6 places the most significant timestamp bits first, enabling simple string-based sorting by creation time, which v1 cannot do.

Use v6 when you need time-sortable GUIDs / UUIDs with >v1 compatibility. It's ideal for database indexing, audit logs, event streams and systems migrating from v1. However, for new systems without v1 compatibility requirements, RFC 9562 recommends v7, which uses Unix timestamps and is simpler.

Not necessarily. While v6 can use a MAC address for the 48-bit node field (like v1), RFC 9562recommends using a random 48-bit value to avoid privacy concerns. Modern implementations should prefer random node IDs with the multicast bit set to distinguish them from real MAC addresses. Check your UUID library's documentation to understand its node ID generation strategy.

Both v6 and v7 provide time-based sortability. V6 uses Gregorian timestamps (60-bit, 100ns precision, epoch 1582) and maintains v1 field compatibility. V7 uses Unix timestamps (48-bit millisecond precision, epoch 1970) with 74 random bits, making it simpler and more widely recommended for new systems. Choose v6 only if you need v1 compatibility or Gregorian timestamp semantics.

Yes, that's the primary advantage of v6. The reordered timestamp bytes enable lexicographical sorting using simple string or byte comparisons. GUIDs / UUIDs generated later will generally sort after earlier ones, making v6 ideal for time-ordered database indexes, event logs and audit trails. However, clock skew or adjustments across distributed systems can occasionally produce out-of-order results.

The clock sequence is a 14-bit counter used to maintain uniqueness when generating multiple UUIDs at the same timestamp or when the system clock moves backward. It's typically initialized with a random value at startup and incremented when needed. This helps prevent collisions in high-frequency generation scenarios or when clocks are adjusted.

It depends on your needs. V6 provides time-based sorting and better write locality for B-tree indexes, reducing fragmentation compared to random v4 GUIDs / UUIDs. This can improve insert performance in some databases. However, v4 provides better privacy (no embedded metadata) and unpredictability. Choose v6 for time-ordered keys with better database performance; choose v4 for privacy and simplicity.

V6 support is still being added to GUID / UUID libraries as RFC 9562 is relatively new (May 2024). Check for updated versions of:
  • JavaScript/Node.js: uuid npm package (v9.0+)
  • Python: Third-party libraries or manual implementation
  • Go: google/uuid package (check for v6 support)
  • Rust: uuid crate (check for RFC 9562 support)
  • Java/C#: Third-party libraries or RFC 9562-compliant implementations
Alternatively, you can implement v6 by reordering v1 timestamp fields according to RFC 9562.

Yes, technically you can reorder the timestamp fields from a v1 GUID / UUID to produce a v6 GUID / UUID with the same timestamp, clock sequence and node values. However, this changes the GUIDs / UUIDs binary representation and string format, so it's not a lossless conversion in the sense that you cannot use the converted GUID / UUID interchangeably with the original v1 GUID / UUID. It's better to generate v6 GUIDs / UUIDs natively going forward.

Conclusion

GUID / UUID v6 is ideal when you need a time-sortable UUID with v1field compatibility. It addresses v1's sortability issues while maintaining the same timestamp, clock sequence and node structure. For new systems without v1 compatibility requirements, RFC 9562 recommends v7, which offers simpler Unix timestamp-based design. If you use v6, prefer implementations that use random node IDs to avoid MAC address privacy concerns.

Disclaimer: All information is provided for general educational and technical reference only. While we aim to keep the content accurate, current and aligned with published standards. No guarantees are made regarding completeness, correctness or suitability for any specific use case.
GUID / UUID specifications, RFCs, best practices, security guidance, database behavior and ecosystem conventions (including cloud platforms and third-party identifier formats) may change over time or differ by implementation. Examples, recommendations, and comparisons are illustrative and may not apply universally.
This content should not be considered legal, security, compliance or architectural advice. Before making critical design, security, or production decisions, always consult the latest official standards and documentation (such as RFC 4122, RFC 9562 and vendor-specific references).
Always evaluate behavior in your own environment.