What Is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit value used to identify information without requiring a central authority to hand out the ids. “GUID” (Globally Unique Identifier) is the same thing under a different name, coined by Microsoft — the two terms are used interchangeably.

A UUID is conventionally written as 32 hexadecimal digits split into five groups by hyphens, in the pattern 8-4-4-4-12, for example f47ac10b-58cc-4372-a567-0e02b2c3d479. That structure isn't arbitrary — certain digits encode the UUID's version and variant, which is how software can tell a v4 UUID apart from a v5 one just by looking at it.

Why not just use an incrementing number?

Auto-incrementing integers work fine inside a single database, but they break down the moment you have more than one system generating ids independently — two services can hand out the same number, and merging datasets from different sources creates collisions. UUIDs solve this by being generated independently, without coordination, while still being collision-resistant. Any two systems, anywhere, generating a v4 UUID at the same moment have a practically zero chance of producing the same value.

The three versions in everyday use

  • v4 — random.Generated from 122 bits of randomness with no embedded information. This is the default choice for primary keys, session tokens, and correlation ids when there's no reason to encode meaning into the identifier itself.
  • v1 — timestamp-based.Encodes the creation time and a node identifier (traditionally a MAC address) directly into the id, making v1 UUIDs sortable by creation order. The tradeoff is that anyone who sees a v1 UUID can extract when — and on what machine — it was generated, so it's a poor fit when the identifier is public-facing and anonymity matters.
  • v5 — deterministic. Computed as a SHA-1 hash of a namespace UUID plus a name string, so the same inputs always produce the same output. Useful for deriving a stable id from something you already have — a URL, an email address, a file path — without needing a lookup table to remember what id you assigned it last time.

Need to generate some? The GUID / UUID Generator on this site creates v1, v4, and v5 identifiers in bulk, entirely in your browser — nothing is sent to a server.

← Back to KeyForge