HomeGuides What Is a UUID (and When to Use One)?

What Is a UUID (and When to Use One)?

UUIDs (universally unique identifiers) are everywhere in software — database keys, API request ids, file names. They let independent systems generate ids that almost never collide, with no shared counter. Here is what they are and when they help.

What a UUID looks like

A UUID is a 128-bit value usually written as 32 hexadecimal digits in five groups separated by hyphens, like 550e8400-e29b-41d4-a716-446655440000. That is an 8-4-4-4-12 character pattern.

Why they are practically unique

There are about 3.4 × 10^38 possible UUIDs. A version-4 UUID fills most of those bits with random data, so the chance of two systems independently generating the same one is vanishingly small — small enough to ignore in practice. That is the whole point: no central server has to hand out ids.

The common versions

  • Version 4 — random, generated from random bytes. The most common; use this unless you have a specific reason not to.
  • Version 1 — time-based, derived from a timestamp and machine identifier.
  • Version 7 — newer, time-ordered and random, so ids sort by creation time (handy for database keys).

When to use a UUID

Reach for a UUID when you need an id that multiple services can create independently — distributed systems, offline-first apps, or public-facing ids you do not want to be guessable sequential numbers. The UUID Generator creates valid version-4 UUIDs right in your browser.

Related tools

Last updated: July 6, 2026