UUID Generator
Generate version 4 UUIDs in bulk. These use your browser's cryptographic random number generator via crypto.randomUUID(), so they are suitable for production use.
What a UUID v4 looks like
A UUID is 36 characters: 32 hexadecimal digits in five hyphen-separated groups, 8-4-4-4-12. In version 4, the digit at position 15 is always 4 to mark the version, and the digit at position 20 is one of 8, 9, a, or b to mark the variant. The remaining 122 bits are random, which is where the uniqueness comes from.
Are collisions possible?
Technically yes, practically no. With 122 random bits there are about 5.3 × 10³⁶ possible values. You would need to generate roughly a billion UUIDs per second for 85 years to reach a 50% chance of a single collision. The genuine risk is not mathematics but implementation: UUIDs built on Math.random() are not cryptographically random and can repeat, particularly across processes started at the same moment. This tool uses crypto.randomUUID(), which is backed by a CSPRNG.
UUIDs as database primary keys
UUIDs let you generate an ID before touching the database, which simplifies distributed systems, offline-first apps, and merging data between environments. They also avoid leaking business information the way sequential integers do — /orders/1042 tells a competitor roughly how many orders you have taken. The trade-off is index performance: random UUIDs scatter writes across a B-tree index, causing page fragmentation. If that matters at your scale, look at UUID v7 or ULID, which are time-ordered and index far better while keeping global uniqueness.