What is a GUID?
A GUID (Globally Unique Identifier) is a globally unique identifier that can be generated through several different algorithms. The GUIDs on this site are generated using a secure random number generator.
UUID Format
UUIDs are 128-bit values typically represented as 32 hexadecimal digits displayed in five groups separated by hyphens, in the form 8-4-4-4-12 for a total of 36 characters (32 alphanumeric characters and 4 hyphens). For example: 550e8400-e29b-41d4-a716-446655440000
What is a Version 1 UUID?
A Version 1 UUID is a universally unique identifier that is generated using a timestamp and the MAC address of the computer on which it was generated. This version includes:
- 60-bit timestamp (number of 100-nanosecond intervals since October 15, 1582)
- 12-bit clock sequence
- 48-bit node identifier (usually the MAC address)
What is a Version 4 UUID?
A Version 4 UUID is a universally unique identifier that is generated using random numbers. The Version 4 UUIDs produced by this site were generated using a secure random number generator. This version includes:
- 122 random bits
- 6 bits for the version (set to 0100)
- 2 bits for the variant (set to 10)
What is a Version 7 UUID?
A Version 7 UUID is a universally unique identifier that is generated using a timestamp, a counter and a cryptographically strong random number. Generally, Version 7 UUIDs have better entropy (i.e. randomness) than Version 1 UUIDs. This version includes:
- 48-bit timestamp (milliseconds since Unix epoch)
- 12-bit counter or random data
- 62 bits of cryptographically secure random data
- 4 bits for version (set to 0111)
- 2 bits for variant (set to 10)
Version 7 UUIDs are particularly useful for database primary keys because they maintain time-ordering while providing good randomness.
What is a Nil/Empty UUID?
A Nil/Empty UUID is a special form that contains all zeros. It has the format: 00000000-0000-0000-0000-000000000000 and is often used to represent a null or undefined UUID.
UUID Versions Comparison
| Version |
Generation Method |
Time-ordered |
Privacy |
Use Case |
| Version 1 |
Timestamp + MAC address |
Yes |
Low |
Distributed systems where uniqueness is critical |
| Version 4 |
Random |
No |
High |
General purpose, privacy-sensitive applications |
| Version 7 |
Timestamp + Random |
Yes |
High |
Database keys, sortable identifiers |
Benefits of Different UUID Versions
- Version 1: Guarantees uniqueness across space and time, but reveals MAC address
- Version 4: High randomness and privacy, but no ordering
- Version 7: Combines benefits of time-ordering and randomness, suitable for databases
Common Use Cases
- Database Primary Keys: UUIDs provide unique identifiers without requiring a centralized key generator
- Distributed Systems: Ensure unique identifiers across multiple systems without coordination
- URLs and Resource Identifiers: Create unguessable, unique identifiers for web resources
- Session Identifiers: Secure session management in web applications
- Transaction IDs: Track operations across distributed systems
Security Considerations
- Version 1 Privacy: May expose MAC address, which can be a privacy concern
- Version 4/7 Security: Use cryptographically secure random number generators to prevent predictability
- Predictability: Predictable UUIDs can be a security risk in certain applications