The text form is 32 hexadecimal digits split into five groups of 8-4-4-4-12 characters. Two
positions carry metadata rather than data. The first digit of the third group is the
version, and the first digit of the fourth group holds the
variant. For standard UUIDs the variant bits are 10, so that
digit is always 8, 9, a or b.
017f22e2-79b0-7cc3-98c4-dc0c0c07398f
└──────┬────┘ │ │
48-bit Unix │ └─ variant: 9 = 1001, top bits "10"
time in ms └────── version: 7
In a v4 UUID, the remaining 122 bits are random. In a v7 UUID, the first 48 bits are the
Unix time in milliseconds, which is why the inspector can turn
017f22e2-79b0-… back into 2022-02-22T19:22:22.000Z (try it with
the epoch converter too: 0x017f22e279b0 is
1645557742000). The other 74 bits are random. Two special values exist as well: the Nil UUID,
which is all zeros, and the Max UUID, which is all f. They work as sentinels
such as "not set" or "upper bound", and they have no version.
The format is defined by RFC 9562, published in May 2024. It replaces RFC 4122, adds versions 6, 7 and 8, and formally defines the Max UUID.