UUID Generator
Generate random v4 or time-ordered v7 UUIDs in bulk, and see which one belongs in a database primary key.
Free · No sign-up · Your inputs stay in your browser
Input
Generate UUIDs
Output
Press Generate
v7 starts with the creation time, so new rows land at the end of a B-tree index instead of at random pages; it is the better primary key for MySQL and PostgreSQL. v4 is all random, and the right choice when the ID must not reveal when it was made.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
v4 or v7?
A v4 UUID is 122 random bits. Inserted as a primary key, each new row lands on a random page of the B-tree index, which causes page splits and a poor cache hit rate as the table grows. A v7 UUID starts with the time it was made, so new rows go to the end of the index the way an auto-increment ID does. RFC 9562 defines both.
The trade-off
v7 reveals when the ID was created, to the millisecond. If that is sensitive, use v4.
In your stack
Laravel's HasUuids trait generates ordered UUIDs by default, and Str::uuid7() is available in recent versions. PostgreSQL has a native uuid type. In MySQL, store UUIDs as BINARY(16) rather than CHAR(36) to more than halve the index size.