⌘K

Developer

UUID

A UUID is a 128-bit identifier, written as 36 hexadecimal characters, designed to be unique without any central coordination between the systems that generate it.

Updated 12 Aug 2026

Identifiers without a coordinator

Traditional ids come from a database sequence, which means something central must hand them out. A UUID is generated locally — by a browser, a mobile app or any service — with a namespace so large that collisions are not a practical concern. That makes offline creation, sharding and cross-system merging straightforward.

The versions that matter

VersionSourceUse it when
v4RandomGeneral-purpose identifiers, default choice
v5Namespace + name (SHA-1)The same input must always produce the same id
v7Timestamp + randomDatabase keys where insert order should be sequential

Version 4 is random, which is exactly what makes it awkward as a clustered primary key: inserts land in random index positions and fragment the B-tree. Version 7 puts a millisecond timestamp in the high bits, so new rows append in order while remaining globally unique.

A UUID is unguessable but not a secret. It carries no permissions, so never treat possession of one as authorisation.

UUID Generator

Create identifiers in bulk in your browser, ready to paste into code or fixtures.

Try UUID Generator

Characteristics

  • 128 bits shown as 8-4-4-4-12 hexadecimal characters
  • Version and variant bits are fixed inside the value
  • Generated independently with no central authority
  • Also called a GUID in Microsoft ecosystems

Common uses

  • Primary keys in distributed or offline-capable systems
  • Request and trace identifiers in logs
  • Idempotency keys for payment and API retries
  • Filenames and object keys that must not collide

Advantages

  • No coordination needed, so clients can create ids offline
  • Safe to merge datasets from multiple sources
  • Does not leak row counts the way sequential ids do
  • Supported natively by most databases and languages

Limitations

  • Sixteen bytes versus four or eight for an integer key
  • Random versions hurt index locality and cache behaviour
  • Hard for humans to read, compare or dictate
  • Not a security token — unguessable is not the same as authorised

Examples

A random v4 and a time-ordered v7 identifier
v4: 9f1c2d7e-4b3a-4c8f-9e21-7d5a6b0c1f34
v7: 01936c7a-1f00-7c3b-8a41-2f9d5e77b0c2
    ^^^^^^^^^^^^ millisecond timestamp prefix

Frequently asked questions

What is a UUID used for?

Uniquely identifying records, requests or files without a central id generator.

Are UUIDs guaranteed unique?

Not mathematically, but the chance of a v4 collision is so small it is ignored in practice.

Which UUID version should I use?

v4 for general identifiers, v7 when the id is a database key and insert ordering matters.

Is a UUID the same as a GUID?

Yes — GUID is Microsoft's name for the same 128-bit identifier format.

Can a UUID be used as a secret token?

No. Use a cryptographically random token of adequate length for anything security-sensitive.

Related terms

All terms

Related tools

Related guides

All guides