What Is a UUID? Understanding UUID Versions (v1, v4, v5, v7)
Comprehensive guide to Universally Unique Identifiers (UUID / GUID). Compare UUID v1 (timestamp), v4 (random), v5 (namespace), and v7 (time-ordered).
What Is a UUID?
A UUID (Universally Unique Identifier)—also referred to as a GUID (Globally Unique Identifier) in Microsoft ecosystems—is a 128-bit number standardized under RFC 4122. UUIDs enable distributed systems to generate unique identifiers independently without central coordination.
UUID String Format
A UUID is represented as 32 hexadecimal digits separated by hyphens into five groups:
xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx
Example: f47ac10b-58cc-4372-a567-0e02b2c3d479
M(digit 13): Specifies the UUID Version (e.g.4).N(digit 17): Specifies the RFC 4122 Variant (8,9,a, orb).
Comparison of UUID Versions
- UUID v1: Generated from host MAC address and 60-bit timestamp. (Leaks hardware MAC address).
- UUID v4: Generated purely from 122 bits of cryptographic pseudo-randomness. (Most popular).
- UUID v5: Generated using SHA-1 hashing over a namespace and name string.
- UUID v7: Modern standard encoding a Unix timestamp with random bits for optimal B-Tree database indexing.