About this tool
Version 4 is fully random. Version 7 starts with a timestamp, so new IDs sort in creation order, which is kinder to database indexes.
Choosing and generating UUIDs
A UUID is a 128-bit identifier written as 36 characters, such as a string of hexadecimal groups separated by hyphens. UUIDs can be created on any device without asking a central database for the next number, which makes them ideal for distributed systems, offline apps, file names, API request IDs and test data. The chance of two properly generated random UUIDs colliding is so small that it can be ignored in practice.
This generator offers two versions. Version 4 is entirely random apart from a few bits that mark its version, and it is the most widely supported choice. Version 7 begins with a timestamp, followed by random bits, so newly created IDs sort in the order they were made. That small difference matters for databases, because inserting IDs that arrive in order keeps indexes compact and fast, while random IDs scatter new rows across the index.
For new database tables, version 7 is often the better default if your database and libraries support it. Version 4 remains a good choice when you do not want IDs to reveal when something was created, for example in public links. Because version 7 contains a timestamp, anyone can read roughly when the ID was generated. You can generate many IDs at once for seeding test data, and choose uppercase or lowercase output to match your system. IDs are created with your browser's secure random number generator and are not stored or sent anywhere. Store them in a native UUID column type where available, which is smaller and faster than plain text.
How to use it
- Choose the options you need.
- Adjust the options. The result updates instantly.
- Copy the result, or download it as a file where offered.
Questions
Can two UUID v4 values collide?
In practice, no. There are 2^122 possible values; generating a billion a second for a century would still be unlikely to produce a duplicate.
Should I use v4 or v7 for database keys?
v7 is usually better for primary keys because it keeps inserts in order and makes indexes faster.
Last reviewed 16 October 2026.
