UUID version history explained - cover art

Comparisons 16 min read

UUID version history explained

November 18, 2026 · 16 min read

UUIDs share a 128-bit layout with version and variant nibbles. The version field tells you how the remaining bits were generated - time and MAC, random, name hash, or newer time-ordered random schemes. Picking the wrong version for your use case causes either privacy leaks (v1) or lack of index locality (v4).

Common layout and version nibble

Canonical string form is 8-4-4-4-12 hex with hyphens. Byte 6 high nibble encodes version; byte 8 encodes variant. Tools like UUID generator let you mint specific versions for experiments.

Versions 1 and 2

v1 combines timestamp with node identifier - sortable by time but exposes hardware-derived node in historical implementations. v2 is DCE security oriented and rarely used in greenfield apps.

Versions 3, 4, and 5

Versions 6 and 7 (time-ordered)

v6 reorders v1 time fields for improved DB locality. v7 combines Unix timestamp ms with random bits - popular for B-tree friendly primary keys while staying opaque. See also uuid v1 v4 v7 explained for selection guidance.

UUID v8 draft (brief)

The v8 draft reserves space for vendor-specific or experimental layouts while keeping version bits at 8. Standards may evolve - treat v8 as experimental unless your organization documents an internal profile. Do not invent custom layouts without coordinating validators and storage.

FAQ

Which UUID version should new APIs use?
v4 for opaque ids; v7 when time-ordering helps database indexes.
Is v5 a hash of the name only?
No - it hashes namespace UUID plus name per RFC 4122.
Can I mix versions in one table?
Yes but document per-row expectations; version nibble tells consumers how to interpret bits.
Is v8 production-ready?
Follow current RFC status; many teams stay on v4/v7 until v8 is finalized.

Related: UUID v1 v4 v7 explained · How UUIDs work internally · UUID vs ULID vs NanoID · UUID security considerations

Browse all tools