UUID v4 vs v7: Which One Should You Use?
A UUID (Universally Unique Identifier) is a 128-bit identifier that can be generated anywhere, by anyone, with no central authority — and still be globally unique. Developers use them for database primary keys, request IDs in distributed systems, file names, and API key prefixes. This tool generates both the ubiquitous v4 and the newer v7 defined in RFC 9562 (2024).
A v4 UUID is 122 bits of pure randomness. This tool uses crypto.getRandomValues — the browser's cryptographically secure random source — rather than Math.random, so the output is genuinely unpredictable. A v7 UUID instead leads with a 48-bit Unix millisecond timestamp followed by random bits, which means plain string sorting equals creation-time sorting.
Why does v7 matter? Using v4 as a primary key in MySQL or PostgreSQL scatters inserts across the whole index, causing frequent B-tree page splits and degraded write performance. v7 values increase almost monotonically, giving you near auto-increment index efficiency while still being safely generatable across distributed nodes. The trade-off: a v7 UUID reveals its creation time, so choose v4 when that timing must stay private.
Generate 1–100 UUIDs at once, toggle uppercase, or strip hyphens for a 32-character hex form. Copy them one at a time or all together — perfect for seeding test data, writing migration scripts, or filling API test payloads. Everything runs locally in your browser. You might also like our password generator for random secrets and hash generator for checksums.