Definition
A UUID (Universally Unique Identifier) is a 128-bit number used to identify information in computer systems. The defining property is independence: any machine can generate a UUID without communicating with any other machine, and the probability of two machines generating the same value is negligible.
UUIDs are defined by RFC 9562 (2024), which superseded RFC 4122. The Wikipedia UUID article provides an accessible overview of the format and version history.
Format
A UUID is written as 32 hexadecimal digits in five hyphen-separated groups:
550e8400-e29b-41d4-a716-446655440000
8 - 4 - 4 - 4 - 12
Two positions carry structural meaning:
- Position 13 (first digit of the third group) — the version digit. Tells you how the UUID was generated:
4for random,7for time-ordered. - Position 17 (first digit of the fourth group) — the variant digit. For standard RFC 9562 UUIDs this is always
8,9,a, orb.
Everything else is version-specific payload — randomness, timestamp bits, or deterministic hash output depending on the version.
Pronunciation and full form
- Full form: Universally Unique Identifier
- Pronunciation: “you-you-eye-dee” (each letter) or “oo-id” (as a word)
- Plural: UUIDs
- Microsoft equivalent: GUID (Globally Unique Identifier) — same standard, different name
Why “universally unique”?
The word “universally” is a practical claim, not a mathematical guarantee. A UUID v4 has 122 bits of randomness, giving a space of 2¹²² possible values. The probability of two independently generated v4 UUIDs colliding becomes meaningful only at approximately 2.7 × 10¹⁸ values — a number far beyond any realistic generation rate. See Collision for the mathematics.
Versions
RFC 9562 defines eight versions. The two used for new work are:
- v4 — 122 bits of cryptographic randomness. No timestamp, no structure, nothing derived from the machine. Use for externally visible identifiers.
- v7 — 48-bit Unix millisecond timestamp + randomness. Sorts chronologically. Use for database primary keys.
For a complete breakdown see UUID Versions.
Common uses
- Database primary keys — generated client-side before a round trip to the server
- Distributed system identifiers — two services can both create records without coordination
- Idempotency keys — identify a request so retries are recognised
- Event and trace IDs — correlate one operation across services and log streams
- Offline-first applications — records created before network connectivity is restored
What a UUID is not
- Not a secret or credential — a UUID in a URL is visible in logs, referrer headers, and browser history
- Not guaranteed unique — probabilistically unique, which is sufficient for all practical purposes
- Not sequential by default — only v6 and v7 are time-ordered; v4 sorts randomly
Generate one now with the UUID v7 generator or UUID v4 generator.
Frequently asked questions
What does UUID stand for?
UUID stands for Universally Unique Identifier — a 128-bit number used to identify information across systems without a central authority. It is written as 32 hexadecimal digits in the format 8-4-4-4-12. The current standard is RFC 9562.
What is a UUID used for?
UUIDs are used as database primary keys, distributed system identifiers, idempotency keys for API requests, event and trace IDs, and offline record creation — any situation where unique IDs must be generated without a central authority.
Should I use v4 or v7?
Use v7 for database primary keys (time-sortable, index-friendly) and v4 for anything where creation order could leak information, like tokens or share links.
What does UUID stand for?
UUID stands for Universally Unique Identifier. It is a 128-bit label used to uniquely identify objects in computer systems without central coordination. The current specification is RFC 9562 (May 2024), published by the IETF. The Wikipedia UUID article covers the history from the Apollo NCS origins through RFC 4122 to RFC 9562.
How unique is a UUID in practice?
UUID v4 has 122 bits of randomness — roughly 5.3 × 10³⁶ possible values. The probability of generating two identical UUIDs is so small it is treated as zero for engineering purposes. GeeksforGeeks illustrates the birthday-problem math: you would need to generate 2.7 × 10¹⁸ UUIDs before a 50% chance of any collision — generating one billion per second for 85 years.
What is the standard format of a UUID string?
The canonical UUID string is 36 characters in the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx — 32 lowercase hexadecimal digits in five groups separated by hyphens. Position 13 (0-indexed) is the version digit and position 17 is the variant digit. This format is defined in RFC 9562 §4. Compact (no hyphens) and URN (urn:uuid:...) representations are also valid.