What the digits actually encode

A UUID uses 32 hexadecimal digits in an 8-4-4-4-12 pattern. In a standards-compliant version 4 UUID, 122 bits are random and 6 encode the version and variant. The third group begins with 4; the fourth begins with 8, 9, a or b. Security and collision properties depend on a sound random generator, not on the visual format alone.

550e8400-e29b-41d4-a716-446655440000 version = 4 variant bit 122 of the 128 bits are randomly generated: only these 2 marker digits are fixed by the format. 2^122 possible values ≈ 5.3 × 10³⁶
A UUID v4 contains fixed version and variant bits; the remaining 122 bits should come from a secure random source.

How unlikely a real collision is

There are 2¹²² possible random portions, about 5.3 × 10³⁶. The birthday approximation puts a 50% collision probability near 2.7 × 10¹⁸ generated values when draws are independent and uniform. That makes accidental collisions extraordinarily unlikely in ordinary systems, but it is not a mathematical guarantee of uniqueness and does not protect against a faulty generator.

When a UUID is the wrong tool

  • When insertion order matters. Random UUID v4 values scatter writes across an index. UUID v7 or another time-ordered identifier may suit databases that benefit from roughly chronological keys.
  • When people must read or type the identifier. A long UUID is better for copying than dictation; a shorter reference code may improve support workflows, provided its collision and guessing risks are handled.
  • When one database already owns the sequence. An auto-incrementing integer is compact and naturally ordered, although it can expose record counts and requires coordination across writers.

Common implementation questions

Hexadecimal UUID text is case-insensitive by specification, although lowercase is the usual canonical presentation.

UUIDs are widely used as primary keys. Random versions can affect index locality and storage size, so the right choice depends on database workload and schema rather than table size alone.

Is a UUID the same as a GUID? Functionally yes; GUID (Globally Unique Identifier) is Microsoft's historical name for the same concept, and the two terms are used interchangeably today.

Generate a UUID

Orisod’s UUID Generator creates one or many version 4 UUIDs from the browser’s secure random source. Treat them as identifiers, not passwords or proof of authenticity.

Generate a UUID →

UUID v4 is a dependable default for decentralized identifier generation when its randomness comes from a suitable source. Choose another scheme when ordering, compactness, secrecy or human usability is the stronger requirement.