UUID v6 Generator
Generate UUID v6 — the reordered, lexically sortable variant of UUID v1. Defined by RFC 9562. Useful for migrating legacy v1 corpora to a sort-friendly format.
Your V6 UUID
V6What is UUID v6?
UUID v6 keeps everything from v1 — the same 60-bit Gregorian-epoch 100ns timestamp, the same 14-bit clock sequence, the same 48-bit node identifier — and simply reorders them so the timestamp's highest bits appear first in the binary and string layout. The consequence: lexical sort = chronological sort, which is the property v1 lacked.
UUID v6 bit layout (RFC 9562 §5.6)
UUID v6 layout
32 bits time_high - high bits of timestamp
16 bits time_mid - middle bits of timestamp
4 bits ver - version, always 0110 (= 6)
12 bits time_low - low bits of timestamp
2 bits var - variant, always 10
14 bits clock_seq - clock sequence
48 bits node - node identifier (random or MAC)How to generate UUID v6 in your code
JavaScript / TypeScript
import { v6 as uuidv6 } from 'uuid';
const id = uuidv6();
// → '1ec9414c-232a-6b00-b3c8-9e6bdeced846'Python
# Python 3.12 added uuid.uuid6():
import uuid
id = uuid.uuid6()Frequently asked questions
UUID v6 is a reordering of the UUID v1 layout that places the timestamp's most-significant bits first. This single change makes v6 UUIDs lexically sortable by creation time — sorting them as strings is identical to sorting them by when they were generated, which v1 cannot do.