UUID v4 Generator -- Random UUID
Generate cryptographically secure random UUID v4 identifiers. Free online UUID v4 generator using crypto.getRandomValues(). Bulk generation with one-click copy.
Frequently Asked Questions
What is UUID v4?
UUID v4 is a randomly generated universally unique identifier. It uses 122 bits of cryptographic randomness (6 bits are reserved for version and variant markers). The format is xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx, where 4 indicates version 4.
How is UUID v4 generated?
This tool uses crypto.getRandomValues() to fill 16 random bytes, then sets the version bits (0100 for v4) at position 13 and the variant bits (10xx) at position 17. The result is formatted as a standard 36-character UUID string.
Is UUID v4 suitable for database primary keys?
UUID v4 works as a primary key but has a drawback: random UUIDs fragment B-tree indexes because inserts are distributed randomly. For better database performance, consider UUID v7 which is timestamp-ordered and maintains index locality.
Can UUID v4 collide?
Theoretically yes, but practically no. With 122 random bits, the probability of collision is 1 in 2^61 after generating 2.71 quintillion UUIDs. For any real-world application, UUID v4 collisions are not a concern.