UUID vs GUID – Same Thing, Different Name
UUID and GUID refer to the same 128-bit identifier format defined by RFC 4122. GUID (Globally Unique Identifier) is Microsoft's name for the same standard. There is no technical difference.
Why two names?
UUID (Universally Unique Identifier) is the open standard term used in RFC 4122, IETF specifications, and most programming languages. GUID is the name Microsoft used when implementing the same standard in COM, Windows APIs, and .NET. They produce identical 128-bit values in the same xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx format.
UUID versions
| Version | How generated | Common use |
|---|---|---|
| v1 | Timestamp + MAC address | Legacy — can leak hardware/time info |
| v3 | MD5 hash of namespace + name | Deterministic from known input |
| v4 | Random | Default choice — database IDs, API resources |
| v5 | SHA-1 hash of namespace + name | Deterministic, more secure than v3 |
| v7 | Unix timestamp + random (new) | Sortable UUIDs for DB indexing |
Which version to use
- v4 — use this by default for new systems (random, zero information leakage)
- v7 — use when you need monotonically increasing IDs for database B-tree performance
- v5 — use when you need deterministic IDs from a known namespace (e.g. same URL always gets same ID)
- Avoid v1 — exposes MAC address and timestamp
Frequently Asked Questions
Can two UUIDs ever be the same?
For v4, the probability is astronomically small — 2^122 possible values. In practice, collision probability is negligible.
Should I use UUID or auto-increment integer IDs?
UUIDs work across distributed systems without coordination. Integers are smaller and faster for single-database lookups. v7 UUIDs give you both: sortability + global uniqueness.
Are GUIDs and UUIDs interchangeable in code?
Yes — they're the same format. .NET's Guid type and Java's UUID class both follow RFC 4122.
