| Version | Type | Appeared | Deterministic? | Sortable? | Secure? | Typical Use | Standardized | Deprecated? | Notes |
|---|---|---|---|---|---|---|---|---|---|
| v1 | Time + Node (historically MAC) | 1997 | No | Yes | MAC leak (historically) | Distributed systems | RFC 4122 (July 2005) | Discouraged (not formally deprecated) | Includes timestamp + Node (historically the MAC address). Ordered but exposes hardware info. |
| v2 | DCE Security (UID/GID) | 1997 | No | Partial | Leaks IDs | Legacy DCE systems | RFC 4122 (July 2005) | Effectively deprecated | Embeds POSIX UID/GID + MAC address. Rarely supported and considered obsolete. |
| v3 | Name (MD5) | 1997 | Yes | No | MD5 | Namespace-based IDs | RFC 4122 (July 2005) | Discouraged | Deterministic, but MD5 is cryptographically broken. |
| v4 | Random | 1997 | No | No | Yes | General purpose (Recommended) | RFC 4122 (July 2005) | No | Pure randomness (122 random bits). Extremely low collision probability. |
| v5 | Name (SHA-1) | 1997 | Yes | No | SHA-1 | Stable API IDs | RFC 4122 (July 2005) | No | Deterministic like v3 but uses SHA-1, which is no longer fully secure. |
| v6 | Ordered time v1 | ~2021 | No | Yes | Yes | Database indexing | RFC 9562 (May 2024) | No | Improved v1 format with sortable structure + privacy-safe design. |
| v7 | Timestamp + randomness | ~2022 | No | Yes | Yes | Latest most modern | RFC 9562 (May 2024) | No | Combines millisecond timestamps with strong randomness. Ideal for distributed systems. |
| v8 | Custom / User-defined | ~2022 | Depends | Depends | Custom | Experimental, app-specific | RFC 9562 (May 2024) | No | Flexible GUID / UUID layout reserved for application-defined use. Not recommended for generic scenarios. |
| empty-nil | Empty / Nil (all zeros) | 2005 | Yes | N/A | No (not unique) | Sentinel / “no value” / placeholder | RFC 4122 RFC 9562 | No | Not a real identifier, used to represent “no value”. Never generate or use it for uniqueness. |
GUID/UUID Version 1-8 - The Complete Comparison
Different GUID / UUID versions serve different purposes and are designed for specific use cases. This comprehensive comparison helps you understand the strengths, weaknesses and ideal applications for each version—from legacy v1 to modern v7 and everything in between.
Understanding GUID / UUID versions
Each GUID / UUID version is optimized for different requirements:
- Time-based versions (v1, v6, v7): include timestamps for natural ordering and database optimization
- Name-based versions (v3, v5): deterministic identifiers derived from names and namespaces
- Random version (v4): pure randomness for general-purpose unique identification
- Custom version (v8): application-defined layouts for specialized use cases
Complete version comparison table
The table below provides a detailed side-by-side comparison of all GUID / UUID versions, including their characteristics, security implications, and recommended use cases.
Choosing the right version
When selecting a GUID / UUID version for your project, consider these factors:
- Database performance: v6 and v7 provide natural ordering that improves index locality and reduces fragmentation
- Security and privacy: avoid v1 and v2 if MAC address exposure is a concern, v4 and v7 are privacy-safe
- Determinism: use v5 (or v3) when you need reproducible IDs from the same input
- Simplicity: v4 is the most straightforward—pure randomness with minimal configuration
- Modern standards: v6, v7 and v8 are part of RFC 9562 (2024), representing current best practices
Legacy vs modern versions
Historically, v1 and v4 dominated GUID / UUID usage under RFC 4122. Modern systems increasingly adopt v7 for its superior database characteristics while maintaining strong security and uniqueness guarantees.
Version encoding in GUIDs / UUIDs
The version number is encoded in the first hexadecimal digit of the third group in the canonical 8-4-4-4-12 format:
Canonical format: 8-4-4-4-12
Example: f47ac10b-58cc-4372-a567-0e02b2c3d479
Layout: xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx
^ ^
| └─ N = Variant (layout family)
└────── M = Version (1-8)
In the example above, the version is 4 (v4 = random). The variant is 3 which maps to 0011 in binary, indicating the RFC 4122/9562 standard layout.
Frequently Asked Questions
8-4-4-4-12 format. Systems that store or transmit GUIDs / UUIDs as strings or binary can handle any version. However, functionality like ordering or determinism is version-specific. RFC 9562 (which introduced v6, v7, v8) maintains full backward compatibility with RFC 4122 (v1-v5).Conclusion
Choose your GUID / UUID version based on your specific requirements. For most modern applications, v7 offers the best balance of performance, security, and functionality. When in doubt, v4 remains a solid, battle-tested choice for general-purpose unique identification.
Learn more
These articles expand on related concepts, formats and practical considerations.