Skip to content

UUID v7 Generator

Generate time-ordered UUIDs (v7). They sort chronologically, which keeps database indexes from fragmenting the way v4 does.

UUID v7

Choosing a UUID version

  • v1 — time plus a node id. Sorts by time in principle, but its byte order means it does not sort lexicographically. Historically leaked the machine MAC address; this tool uses a random node id instead.
  • v3 / v5 — derived from a namespace and a name. Deterministic, so the same input always gives the same id. v5 (SHA-1) is preferred over v3 (MD5).
  • v4 — pure randomness. The default choice when you just need a unique id.
  • v6 — v1 with the timestamp reordered so it sorts correctly.
  • v7 — Unix milliseconds plus randomness. The best choice for database keys.

Frequently asked questions

Which version should I use by default?

v4 for general identifiers, v7 when the value will be a database primary key or needs to sort by creation time.

Does the UUID format itself vary?

No. Every version is 128 bits written as 32 hex characters in 8-4-4-4-12 groups; only the meaning of the bits differs.

Related tools