UUID v4 Generator Online — Free UUIDv4 Tool

What Is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit label formatted as xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx — 32 hexadecimal digits in five groups. The design goal is that any two independently generated UUIDs will be unique across all space and time, without coordination between systems.

📋 UUID Versions

VersionBased onUse when
v1MAC address + timestampSortable by creation time; exposes MAC address (avoid in security-sensitive contexts)
v3MD5 hash of namespace + nameDeterministic ID from a known name (e.g. URL → UUID); reproducible
v4RandomMost common. Fully random, no structure, suitable for anything requiring uniqueness without ordering
v5SHA-1 hash of namespace + nameLike v3 but SHA-1; deterministic and reproducible
v7Unix timestamp + randomNewer standard: sortable like v1, but based on Unix time with no MAC leak — preferred for DB primary keys

🗄️ UUIDs as Database Primary Keys

Using UUIDs (v4) as primary keys is common in distributed systems because IDs can be generated client-side without a round trip to the database — no auto-increment race condition. The tradeoff: random UUIDs cause index fragmentation in B-tree indexes (especially MySQL/InnoDB) because new rows don't land at the end of the index. Solutions:

🔐 How Random Are v4 UUIDs?

A v4 UUID has 122 bits of randomness (6 bits are fixed for version/variant). That means there are 2¹²² ≈ 5 × 10³⁶ possible values. If you generated 1 billion UUIDs per second for the entire age of the universe, the probability of a collision would still be essentially zero. This generator uses crypto.randomUUID() — the browser's CSPRNG — not Math.random().

Generated entirely in your browser. Nothing is sent to any server.

Related Tools