UUID Versions Explained (v1–v7)

Understand the different UUID versions and when each is used.

UUIDs (Universally Unique Identifiers) are 128-bit values used to uniquely identify records, sessions, and resources. RFC 4122 defines several versions with different generation strategies.

Common versions

  • v1 — time-based with MAC address (predictable, avoid for security)
  • v4 — random (most common for IDs and tokens)
  • v5 — SHA-1 hash of namespace + name (deterministic)
  • v7 — Unix timestamp + random (sortable, newer standard)
Generate UUID v4Validate a UUID