Skip to content
100% in your browser. Nothing you paste is uploaded — all processing runs locally. Read more →

UUID v6 Generator

UUID v6 is "v1 with the timestamp bits reordered to be sortable." It exists for migrating from v1; for new code, use v7.

The problem v6 solves

UUID v1 encodes a 60-bit timestamp, but in three reordered chunks: time_low first, then time_mid, then time_hi_and_version. Lexicographic sort on the resulting string does not produce chronological order, which makes v1 UUIDs poor primary keys for time-series data.

v6 fixes this by reading the timestamp bits in their natural most-significant-first order. Same 1582 epoch, same 100-nanosecond precision, same node ID layout — just sortable.

Bit layout

v1: time_low(32) | time_mid(16) | ver|time_hi(12) | var|seq(14) | node(48)
v6: time_hi(48)  | time_mid(12) | ver           | time_lo(12)| var|seq + node

v6 vs v7

v6v7
Epoch1582-10-15 (UUID epoch)1970-01-01 (Unix)
Precision100 nanoseconds1 millisecond
Timestamp bits6048
Random bits6274
Node IDretained from v1none
Standard library support (2026)narrowgrowing fast
Recommended for new codenoyes

When v6 makes sense

The main scenario: you have an existing system on v1 UUIDs and want to introduce sortability without changing what the timestamp means. v6 lets you keep the same 1582-epoch / 100ns-precision interpretation — every existing v1 timestamp parser still works on the timestamp portion of v6 (after byte reordering).

For literally any other case — green-field projects, new tables, new services — pick v7.

Generating v6

The npm uuid package this site uses does not yet support v6, so the generator above produces v1 by default — the closest available cousin. To produce v6 in your code:

// Java (uuid-creator)
import com.github.f4b6a3.uuid.UuidCreator;
UuidCreator.getTimeOrdered();             // v6

// Go (gofrs/uuid)
import "github.com/gofrs/uuid/v5"
v6, _ := uuid.NewV6()

// Rust (uuid crate with v6 feature)
use uuid::{Uuid, ContextV7};
let v6 = Uuid::now_v6(&context, node_id);

Decoding a v6 timestamp

Same epoch and precision as v1 — see the v1 page's decode example. The only difference is the byte order: with v6, you concatenate the first three groups in natural order (no reshuffling). The validator handles both automatically.

FAQ

What is UUID v6?

UUID v6 is the 'v1 with sortable timestamp' variant standardized in RFC 9562 (May 2024). It takes v1's 60-bit timestamp and reorders the bytes so that lexicographic sort matches chronological sort — fixing v1's biggest practical issue.

v6 vs v7 — which should I use?

v7 in almost every case. v7 has a cleaner Unix-millisecond timestamp, no node-ID legacy, and broader library support. v6 exists primarily for systems that need to migrate from v1 while preserving as much of the v1 structure as possible. For a fresh choice, pick v7.

When is v6 the right choice?

Migrating an existing v1 codebase where you want time-ordered IDs without changing the timestamp format. v6 keeps the same 1582 epoch and 100-nanosecond precision — your v1 timestamps and v6 timestamps mean the same thing. v7 starts from the Unix epoch and uses milliseconds.

Is v6 supported in libraries?

It is, but less broadly than v7. uuid-creator (Java), gofrs/uuid (Go), and the Rust uuid crate all support v6. The npm uuid package and Python's standard library do not (as of early 2026).