UUID · 4 bits
UUID version and variant bits
The fixed bits that tell a parser how the identifier was built.
Key facts
| Version field | 4 bits |
|---|---|
| Variant field | 2 bits, RFC 9562 variant is 10xx |
| Location | Third and fourth groups |
| Versions in use | 1, 3, 4, 5, 6, 7, 8 |
| Version 2 | DCE security, rarely used |
| Unknown values | Parsers should still accept and preserve |
How a parser knows the type
The version nibble plus the variant bits identify the construction. A value with version 4 is expected to be random; version 7 is expected to start with a timestamp. Parsers must not assume the version matches their own generator — they should validate the format and preserve the value.
Why the variant matters
The variant distinguishes RFC 9562 UUIDs from the legacy NCS and Microsoft variants. A UUID with a different variant is still 128 bits, but its version field may mean something else. When validating input, check both fields before trusting the rest of the layout.
Frequently asked questions
How do I tell a UUID's version from the string?
Look at the first hex digit of the third group: that is the version number.
What is version 8?
A custom layout defined by the application, with the version and variant bits still fixed by the standard.
Do I need to validate version bits?
Only if your system requires a specific version. Otherwise validate the 128-bit format and treat the value as opaque.