A UUID (Universally Unique Identifier), also called a GUID, is a 128-bit value written as 32 hexadecimal characters in five hyphen-separated groups: 8-4-4-4-12. The format means values are effectively unique without any server coordinating the next number.
What Is a UUID?
UUID v4 vs UUID v7
UUID v4 is built from secure random bytes, so its values have no natural order — great for general-purpose IDs. UUID v7 starts with a millisecond timestamp and then random bits, so values sort by creation time, which helps in databases and logs. Neither is universally better; the choice depends on your use case.
How UUIDs Are Structured
The third group's first digit is the version (4 for v4, 7 for v7) and the fourth group's first digit is the variant (usually 8, 9, a, or b). Together they describe how the identifier was generated and distinguish UUIDs from other 128-bit schemes.
Where UUIDs Are Used
- Databases: primary or secondary keys created independently across nodes.
- APIs: request and event IDs that travel with a call through queues and services.
- Distributed systems: correlation IDs that tie one user action together across many services.
Why Generate UUIDs in the Browser?
Creating UUIDs client-side with the Web Crypto API means the values never leave the user's device, which is better for privacy and works offline after the page loads. A UUID Generator makes producing and validating them a one-click task.