Generate v4 UUIDs instantly for apps, APIs, and databases.
This generator creates Version 4 UUIDs (Universally Unique Identifiers) using the browser's crypto.randomUUID() API (or crypto.getRandomValues() as a fallback). A UUID v4 consists of 128 bits of random data formatted as 32 hexadecimal characters in the pattern xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx, where the 4 indicates version 4 and y is one of 8, 9, a, or b.
UUIDs are used as unique identifiers for database records, API resources, file names, session tokens, and distributed system entities — anywhere you need a globally unique ID without a central registry.
The probability of generating two identical UUID v4s is approximately 1 in 5.3×10^36 — astronomically small. In practice, UUID v4 collisions are treated as impossible for all engineering purposes. You can safely use them as primary keys without checking for duplicates.
UUID v1 is time-based and embeds the MAC address of the generating machine — sortable but privacy-leaking. UUID v4 is purely random — not sortable but maximally private. UUID v7 (a newer standard) is time-ordered random, combining sortability with randomness — ideal for database primary keys. For most use cases, v4 is the safe default.
Yes, but with a caveat: UUID v4 values are not sequential, which means random insertion order can cause B-tree index fragmentation in some databases (notably MySQL InnoDB). For high-volume tables, consider UUID v7 or a ULID (Universally Unique Lexicographically Sortable Identifier) instead, which are both random and time-ordered.