UUID v6 Generator - Create Ordered Timestamp-Based UUIDs

Generate ordered timestamp-based UUID version 6 online. Create UUIDs that are time-ordered for optimal database indexing and sorting.

Try these examples:

What is UUID v6?

UUID version 6 is a time-based 128-bit identifier (36-char string) proposed as an improvement to UUID v1. It consists of:

  • Reordered timestamp: 60-bit timestamp from most to least significant
  • Clock sequence: 14-bit counter for clock adjustments
  • Node ID: 48-bit value (typically MAC address)

Format example: 1eb527d6-e927-6511-9a03-0242ac130003

How UUID v6 works

  1. Calculate current timestamp (100ns intervals since 1582-10-15)
  2. Reorder timestamp bits for better sorting (most significant bits first)
  3. Get/increment 14-bit clock sequence (for uniqueness if clock moves backward)
  4. Obtain 48-bit node ID (usually from MAC address)
  5. Set version bits (0110) and variant bits (10)
  6. Assemble as 32 hex digits with hyphens: 8-4-4-4-12 format

Advantages & Considerations

AdvantagesConsiderations
  • Lexicographically sortable
  • Embedded creation time
  • High performance generation
  • Distributed generation
  • MAC address privacy concerns
  • Clock synchronization issues
  • More predictable than random UUIDs
  • Draft specification status

UUID v6 Structure

BitsContent
0-47High 48 bits of timestamp
48-51Version (0110 for v6)
52-59Low 8 bits of timestamp
60-63High 4 bits of timestamp
64-65Variant (10 for RFC4122)
66-79Clock sequence (14 bits)
80-127Node ID (48 bits)

UUID v6 vs. other versions

VersionBased onUse casePrivacy
UUID v1Time + MACTime-ordered IDs⚠️ Reveals MAC
UUID v3Namespace + MD5Deterministic IDs✅ Private
UUID v4RandomSecure random IDs✅ Private
UUID v5Namespace + SHA-1Deterministic IDs✅ Private
UUID v6Time (reordered)Sortable IDs⚠️ Reveals MAC
UUID v7Time + randomSortable IDs✅ Private

Common Use Cases

  • Time-sortable database keys: For chronological sorting
  • Distributed databases: With time-ordered indexing
  • Log entries: With natural chronological order
  • Audit trails: With embedded timestamps
  • Message queuing: For time-based processing
  • Transaction records: With chronological ordering

Frequently Asked Questions

What's the difference between UUID v1 and v6?

UUID v6 rearranges the timestamp bits from UUID v1 to make it naturally sortable in lexicographical order. The content is identical to v1, just reordered.

Is UUID v6 an official standard?

UUID v6 is currently a draft specification in the proposed RFC 4122bis document. It's not yet an official RFC standard but is implemented in many UUID libraries.

Can I extract the creation time from UUID v6?

Yes. The timestamp component can be extracted from bits 0-59 and converted back to a datetime value.

Are UUIDs v6 sortable by creation time?

Yes. Unlike v1, UUID v6 places timestamp bits in most-to-least significant order, allowing direct lexicographical (string) comparison to match chronological order.

Does UUID v6 expose my MAC address?

By default, yes. Like UUID v1, most implementations use the MAC address for the node ID. Privacy-focused implementations may use random node IDs instead.

Resources