UUID / GUID Generator
Generate one or many UUIDs (v4 random, v7 time-ordered, or Nil). Cryptographically random, browser-side.
UUIDs at a glance
A UUID (Universally Unique Identifier) is a 128-bit value formatted as 32 hex digits with dashes: xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx, where M is the version (1-7) and N indicates the variant. The probability of generating duplicate UUIDs is functionally zero โ you'd need to generate billions per second for years to expect a collision.
The versions you might actually use
| Version | How it's generated | Use case |
|---|---|---|
| v1 | MAC address + timestamp | Largely obsolete (leaks MAC) |
| v3 | MD5 hash of name + namespace | Deterministic IDs from names |
| v4 | 122 random bits | General-purpose IDs (most common) |
| v5 | SHA-1 hash of name + namespace | Like v3 but more secure |
| v6 | Reordered v1 โ sortable | Newer; database-friendly |
| v7 | Unix timestamp ms + random | Recommended for new systems; time-sortable |
Why v7 is becoming preferred
v4 UUIDs are perfectly random, which is bad for databases โ inserts go into random pages of the B-tree, fragmenting the index. v7 UUIDs start with a 48-bit Unix millisecond timestamp, so they sort by creation time. New rows insert at the end of the index, like an auto-increment integer, with the global-uniqueness of a UUID. Best of both.
