UUID and GUID Explained: Generate Version 4 Unique Identifiers
Generate collision-resistant 128-bit unique keys for distributed systems, microservices, and database primary keys without central coordination.
What is a UUID (or GUID)?
A UUID (Universally Unique Identifier), also referred to as a GUID (Globally Unique Identifier), is a 128-bit label formatted as 32 hexadecimal digits separated by hyphens (e.g., f47ac10b-58cc-4372-a567-0e02b2c3d479).
UUID Versions
- UUID v4 (Random): Generated using cryptographically strong pseudo-random numbers; the most popular choice today.
- UUID v1 (Time-based): Constructed from the host MAC address and current timestamp.
β Frequently Asked Questions (FAQ)
What is the probability of a UUID v4 collision? βΎ
The odds of generating duplicate v4 UUIDs are approximately 1 in 2^122βfar lower than the chance of being struck by lightning multiple times.