UUID versions, side by side

byte array7 sectionsUpdated

Eight layouts share one shape. v4 is chance, v7 is a clock plus chance, v3 and v5 are hashes of a name, v1 and v6 are a clock plus a machine, v8 is whatever you define, and Nil and Max are constants with no version at all.

The version nibble picks a layout, and the layouts have almost nothing in common beyond the six bits that name them. This page puts all of them in one table so the choice takes a minute rather than an afternoon.

What the converter readscomputed by the converter itself
in0c5b2444-70a0-4932-980c-b4dc0d3f02b5outuuid · RFC 9562 (10xx) · version 4

Random

in01890a5d-ac96-774b-bcce-b302099a8057outuuid · RFC 9562 (10xx) · version 7

Time-ordered

incfbff0d1-9375-5685-968c-48ce8b15ae17outuuid · RFC 9562 (10xx) · version 5

SHA-1 of the DNS namespace and example.com

in00000000-0000-0000-0000-000000000000outuuid · NCS (0xxx) — reserved, backward compatibility · no version · nil, palindrome

Nil: no version, no variant

Open the converter: byte arrayNothing you paste leaves the browser.
On this page (7)

The whole table#

VersionMade fromSorts by timeRevealsReach for it when
v160-bit clock since 1582 + nodenocreation time, often the MACyou are reading identifiers from an older system
v2DCE Security: clock, local domain and idnoa POSIX UID or GIDnever, unless DCE asks
v3MD5 of a namespace and a namenonothing, but the name is guessableyou need determinism and MD5 is already the convention
v4122 random bitsnonothingyou need an identifier and nothing more
v5SHA-1 of a namespace and a namenonothing, but the name is guessablethe same input must always give the same identifier
v6the v1 clock, reorderedyescreation time, often the MACyou already generate v1 and want ordering
v748-bit Unix ms + 74 random bitsyescreation time to the millisecondit is a database key, which is the usual case
v8whatever you defineif you design it that waywhatever you put in ityou need custom structure in a valid UUID
Nilall zerosnothingyou need an obvious placeholder
Maxall onesnothingyou need an upper bound for a range query

RFC 9562 § 5 · UUID LayoutsEvery layout in the standard, in one section

Where the version actually lives#

Bits 48 to 51 hold the version: the 13th hex digit, first character of the third group. Bits 64 and 65 hold the variant at the top of the 17th digit. An identifier whose 17th digit is 8, 9, a or b belongs to RFC 9562; anything else is NCS, Microsoft or reserved, and its version nibble means nothing.

RFC 9562 § 4.2 · Version FieldThe version field

Version 2 is real, and you will not use it#

DCE Security identifiers give time_low to a local id, a POSIX UID or GID, and half the clock sequence to a local domain. What remains is a coarse, partial timestamp. RFC 9562 documents the layout for completeness; almost no library generates it, and most decoders report it as unknown.

local_id 0-31time_mid 32-47version 48-51time_high 52-63variant 64-65clock_seq_hi 66-71local_domain 72-79node 80-127

DCE Security spends time_low on a local id and half the clock sequence on a local domain.

RFC 9562 § 5.2 · UUID Version 2The v2 layout, which most tools quietly ignore

The standard moved in 2024#

RFC 9562 replaced RFC 4122 in May 2024. Versions 1 to 5 are unchanged; v6, v7, v8 and the Max UUID are new. A page that describes UUID versions and cites RFC 4122 is describing a document that never mentioned a time-ordered layout. Worth remembering when comparing sources.

Questions people actually ask#

Which UUID version should I use?

v7 for database keys, v4 when you only need uniqueness, v5 when the identifier must be derived from a name. Everything else is for compatibility with an existing system.

Why is there no version 2 in most libraries?

v2 is DCE Security. It spends fields on a POSIX UID and a local domain, is rarely useful outside DCE, and most implementations skipped it.

Do Nil and Max UUIDs have a version?

No. All zeros and all ones set neither a valid version nor the RFC variant, which is exactly what makes them unmistakable as placeholders.

Browse the reference