What Is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit value used to identify data in software systems without a central authority assigning them. Here is everything you need to know.
The format
A UUID is always 32 hexadecimal characters (0–9 and a–f), displayed in five groups separated by hyphens in the pattern 8-4-4-4-12:
The total length is 36 characters (32 hex digits + 4 hyphens). The character at position 13 (the first character of the third group) is the version number. In the example above, it is 4, meaning UUID v4.
Why UUIDs exist
Before UUIDs, systems that needed unique identifiers typically relied on a central database to hand out sequential numbers (1, 2, 3…). This works fine on a single server but breaks down when multiple systems need to independently generate IDs and later merge their data without collisions.
UUIDs solve this: any system can independently generate a UUID with a negligible probability of collision. Two servers running on opposite sides of the world can each generate a million UUIDs and there is virtually no chance any two will match.
UUID versions
| Version | Method | Use case |
|---|---|---|
| v1 | Timestamp + MAC | Time-sortable, distributed databases |
| v3 | MD5 hash of name | Deterministic IDs from known input |
| v4 | Random (crypto) | General purpose — most common |
| v5 | SHA-1 hash of name | Like v3, but stronger hash |
| v6 | Reordered timestamp | Like v1, but sortable |
| v7 | Unix timestamp + random | Modern time-ordered IDs |
UUID v4: why it is the default
UUID v4 uses 122 random bits (6 bits are reserved for the version and variant). This produces 2¹²² ≈ 5.3 × 10³&sup6; possible values. Even if you generated one billion UUIDs per second, it would take approximately 86 years before the probability of a single collision reached 50%. For practical purposes, v4 UUIDs are unique.
v4 is the right choice for almost all use cases: database primary keys, session tokens, API keys, log correlation IDs, and file names. It requires no network call, no central coordinator, and no knowledge of the machine or time.
UUID vs auto-increment integers
Auto-increment integers (1, 2, 3…) are smaller, faster to index, and human-readable. UUIDs are larger (16 bytes vs 4–8 bytes), slightly slower to index, and harder to read. The advantage of UUIDs is that they can be generated anywhere without coordination — which matters in distributed systems, offline-first apps, and microservices where records are created across multiple services before being written to a database.
UUID vs GUID
They are the same thing. UUID is the term from the RFC 4122 standard, used in Linux, macOS, and web development. GUID (Globally Unique Identifier) is Microsoft's name for the same concept, used in Windows and .NET. Same format, same generation methods, different name.
Generate a UUID now
v4, v1, bulk mode, uppercase, no-hyphens — all free, no sign-up.
Use UUID Generator →Frequently asked questions
What does UUID stand for?
UUID stands for Universally Unique Identifier. It is a 128-bit label used to identify information in computer systems. UUIDs are also sometimes called GUIDs (Globally Unique Identifiers), particularly in Microsoft ecosystems — the terms refer to the same concept.
What does a UUID look like?
A UUID is 32 hexadecimal characters displayed in five groups separated by hyphens: 8-4-4-4-12. For example: 550e8400-e29b-41d4-a716-446655440000. The total length including hyphens is 36 characters. The character at position 13 (the first character of the third group) indicates the version number.
What are UUID versions?
There are 8 UUID versions. Version 1 is time-based (encodes the timestamp and MAC address). Version 3 and 5 are name-based (deterministic UUIDs from a namespace and name using MD5 or SHA-1 hashing). Version 4 is random (128 random bits, the most common). Version 6 and 7 are newer time-ordered versions. Version 8 is custom.
Are UUIDs truly unique?
In practice, yes. UUID v4 has 122 random bits, giving 5.3 x 10^36 possible values. The probability of generating two identical UUIDs even after generating one billion per second for 100 years is negligible. Collisions are theoretically possible but effectively impossible in practice.
When should I use a UUID?
Use UUIDs as primary keys in databases (especially distributed systems where auto-increment integers would conflict), as session tokens, as correlation IDs in logs and distributed tracing, as idempotency keys for API requests, as file names that must not conflict when generated by multiple systems, and anywhere you need two independent systems to create unique IDs without coordinating.
What is the difference between UUID and GUID?
UUID and GUID refer to the same concept. UUID is the term used in the RFC 4122 standard and is common in Linux, macOS, and web development contexts. GUID (Globally Unique Identifier) is the term Microsoft uses in Windows and .NET. Both follow the same format and generation methods.