What Is UUID v4 and How Is It Used?
Learn how random UUID version 4 identifiers work and when they are useful.
What is a UUID?
A Universally Unique Identifier (UUID) is a 128-bit identifier represented in a standard textual form, commonly as hexadecimal groups separated by hyphens.
What makes UUID v4 different?
UUID version 4 is generated primarily from random or pseudorandom bits, with specific bits reserved to identify the version and variant. It is commonly used when an application needs identifiers without asking a central service for each one.
Are UUIDs guaranteed to be unique?
No finite random identifier scheme can provide an absolute mathematical guarantee of uniqueness. With a correctly generated UUID v4, collision probability is extremely low for ordinary application use, but system design should still handle uniqueness constraints where needed.
Where are UUIDs used?
UUIDs are used as database identifiers, request correlation IDs, object identifiers, and identifiers in distributed systems. They are not secrets and should not be used as authentication credentials.
UUID versus sequential IDs
Sequential IDs are compact and can be efficient for indexing, but they may reveal ordering or approximate record counts. UUIDs can be generated across multiple services without coordinating a sequence, though they are larger and may have different database-index performance characteristics.
Try the Sudarvix UUID generator
Use the Sudarvix UUID Generator to create random version 4 identifiers for development and testing.
Explore related tools
Put the concepts into practice with Sudarvix utilities.