UUID generator
Generate random (v4) or time-ordered (v7) UUIDs.
About UUID versions
- UUID v4
- Randomly generated, and the most common choice for general-purpose unique identifiers.
- UUID v7
- Time-based with millisecond precision, so IDs sort by creation time. A good fit for database primary keys.
About the UUID generator
This UUID generator creates version 4 (random) or version 7 (time-ordered) UUIDs, up to 50 at a time. Use it when you need IDs for test data, database seeds, fixtures, or configuration files and don't want to write a script to generate them.
How to use it
- Choose v4 · random or v7 · time-based.
- Pick a Quantity of 1, 5, 10, 25, or 50, and check Uppercase or No dashes if you need a different format.
- Click Generate UUID (or Generate UUIDs).
- Copy a single UUID with the button next to it, or use Copy all to copy the list with one UUID per line. Clear removes the list.
Format
UUIDs are shown in the standard 8-4-4-4-12 hexadecimal format, such as 3f2b8c1e-9d4a-4e7b-a2c5-6f1e0d9b8a73. No dashes gives a 32-character string, and Uppercase switches the letters to A-F.
Randomness
The random bits come from crypto.getRandomValues, the browser's cryptographically secure generator. Even so, a UUID is an identifier, not a secret: v7 values reveal their creation time.
Privacy
UUIDs are generated in your browser. Nothing is sent to or stored on a server.
Questions
- What is the difference between UUID v4 and v7?
- A v4 UUID is almost entirely random. A v7 UUID starts with a 48-bit Unix timestamp in milliseconds followed by random bits, so v7 IDs sort roughly in creation order.
- Why use UUID v7 for database primary keys?
- Because v7 values increase over time, new rows are inserted near the end of a B-tree index instead of at random positions. That usually means less index fragmentation and better insert performance than with v4.
- Can two UUIDs ever be the same?
- In theory yes, but with 122 random bits in a v4 UUID the chance of a collision is negligible for practical purposes.