What is UUID (Universally Unique Identifier)?

A UUID is a 128-bit identifier designed to be unique across space and time without a central authority, written as 32 hex digits in five groups.

A UUID, or Universally Unique Identifier, is a 128-bit value used to label information so that identifiers generated independently on different systems are effectively guaranteed not to collide. It is written as 32 hexadecimal digits split into five hyphen-separated groups in the pattern 8-4-4-4-12, for example 550e8400-e29b-41d4-a716-446655440000. UUIDs are also called GUIDs in some ecosystems.

The key advantage of UUIDs is decentralized generation. Because the space of possible values is astronomically large, any machine can create a UUID at any time without coordinating with a central server, and the odds of two independently generated UUIDs matching are negligible. This makes UUIDs ideal for distributed systems, offline data creation, and merging records from multiple sources.

There are several versions. Version 4 is the most common, using random or pseudo-random bits, and is the default choice for most applications. Version 1 encodes a timestamp and machine identifier, and newer versions like v7 are time-ordered, which improves database index performance while retaining uniqueness. The version is encoded in one of the digits, so you can identify it from the string itself.

UUIDs are widely used as primary keys, correlation IDs for tracing requests across services, idempotency keys, and identifiers in APIs and event streams. The trade-offs versus sequential integer IDs are size and readability — UUIDs are longer and not human-friendly — and, for random versions, poorer database locality, which time-ordered variants and alternatives like ULID were designed to address.

Examples

  • 550e8400-e29b-41d4-a716-446655440000 — a version 4 UUID
  • Using a UUID as a database primary key generated on the client
  • A correlation ID tagging one request as it flows across microservices

Frequently asked questions

Free tools for working with UUID (Universally Unique Identifier)

Related terms