Not quite random.

A UUID looks like 32 random hex digits. One of them names the version, and the version decides what the others are made of: time, a hash, a machine, or chance.

Version 8. Only the version and the variant are fixed. The other 122 bits are yours to define.

2489e9ad-2ee2-8e00-8ec9-32d5f69181c0
The example printed in RFC 9562.

Field by field

What each part of the UUID above is for, and what these particular digits say.

  1. custom_a48 bits

    Bits whose meaning your application defines. In this example from the RFC, custom_a and custom_b hold a timestamp in 10-nanosecond steps: 2022-02-22 19:22:22 UTC.

  2. ver4 bits

    The version, always the 13th digit. 8 means a custom layout. In binary, 1000.

  3. custom_b12 bits

    More bits of yours.

  4. var2 bits

    The variant: the first two bits of digit 17, always 10 in an RFC 9562 UUID. That is why digit 17 is 8, 9, a or b. Here 8 is 1000: the variant, then two bits of custom_c.

  5. custom_c62 bits

    More bits of yours. Only the version and the variant are fixed. In this example, random.

Every version, one grid

The examples printed in RFC 9562. Whatever the version, the 13th digit names it and the 17th carries the variant.

Which one? For database keys, v7: it sorts by the time it was made. For ids that should give nothing away, v4. When the same name must always map to the same id, v5. The rest serve old systems (v1, v3), moves off v1 (v6) and layouts of your own (v8). There is no v2: RFC 9562 leaves it to DCE Security.