UUID Generator
What is a UUID and what is it used for?
A UUID (Universally Unique Identifier) is a 128-bit identifier designed to be globally unique without the need for central coordination. It is commonly used in databases, distributed systems, APIs, and backend applications to identify records, sessions, transactions, or resources. Thanks to the vast number of possible combinations, a UUID practically eliminates the risk of identifier collisions even in very large systems.
Generated based on time and the device's MAC address. Provides uniqueness but may reveal system information.
A deterministic UUID generated based on a namespace and name using the MD5 hash function.
The most popular version — generated randomly using a cryptographic random number generator.
Similar to v3, but uses SHA-1 instead of MD5. Often used when determinism and greater security are needed.
UUID Structure
| Segment | Length | Description | Example |
|---|---|---|---|
time_low |
8 characters | The first part of the identifier; in v1, it contains part of the timestamp. | 550e8400 |
time_mid |
4 characters | The second part of the timestamp. | e29b |
time_hi_and_version |
4 characters | Contains the UUID version. | 41d4 |
clock_seq |
4 characters | Clock sequence preventing collisions. | a716 |
node |
12 characters | Node identifier (e.g., MAC in v1 or random data in v4). | 446655440000 |
Where are UUIDs used
UUID
UUID
UUID
UUID
UUID
UUID
Frequently Asked Questions (FAQ)
A UUID does not guarantee absolute mathematical uniqueness, but the probability of collision is extremely low. In version v4, there are approximately 3.4×10^38 possible combinations, which in practice eliminates the risk of duplicates.
UUIDs can be generated independently on multiple servers without a central database. This makes them excellent for microservices architecture and distributed systems.
Yes. A UUID does not reveal the order of records or the number of users, so it is safer than incremental identifiers in public APIs or links.
A UUID has 128 bits to provide a massive identifier space and minimize the risk of collisions even in very large systems.
It can. A UUID as a primary key tends to be slower than integers because it is larger and less ordered. Many systems use UUIDs in binary format or so-called UUIDv7/ULID for better indexing.
It depends on the version. UUID v1 contains time and device MAC information, while UUID v4 is completely random and contains no readable data.