How to use the UUID / GUID Generator
- Choose version 4 for general unique IDs, or version 7 if you want IDs that sort by creation time, which suits database primary keys.
- Enter how many you need, up to 1,000.
- Pick a format: uppercase, without hyphens, or wrapped in braces as some Microsoft tools expect.
- Copy one, copy all, or download them as a .txt file.
How it works
Both versions follow RFC 9562, which replaced RFC 4122 in 2024. A UUID is 128 bits shown as 32 hexadecimal digits in groups of 8-4-4-4-12.
Version 4 fills 122 bits with random data from the browser's cryptographic generator (crypto.randomUUID or crypto.getRandomValues) and uses the remaining 6 bits to mark the version and variant.
Version 7 puts the current Unix time in milliseconds in the first 48 bits, followed by random bits. IDs primarily sort by timestamp, which can improve database insertion locality. IDs created in the same millisecond have random relative order, and a clock moving backwards can affect ordering.
Version 4: xxxxxxxx-xxxx-4xxx-Nxxx-xxxxxxxxxxxx (N is 8, 9, a, or b)
Version 7: tttttttt-tttt-7xxx-Nxxx-xxxxxxxxxxxx (t = timestamp)Worked example: choosing between version 4 and version 7
A version 4 UUID such as 3b241101-e2bb-4255-8caf-4136c566a962 has a 4 at the start of the third group. Its order is random, so inserting many into a database index scatters writes across the index.
A version 7 UUID begins with the timestamp, for example 01928f4e-..., so new rows land at the end of the index. Many databases and ORMs now recommend version 7 for primary keys for this reason.
Limitations
- Version 7 reveals the approximate time an ID was created. Use version 4 if creation time should not be inferable.
- UUIDs are unique in practice, not by guarantee. Version 4 has 122 random bits. Version 7 combines a timestamp with random bits. Collision risk depends on the version, random source, and volume; neither version is a mathematical guarantee of uniqueness.
- Generated IDs exist only in this page until you copy or download them; refreshing creates new ones.
Frequently asked questions
What is the difference between a UUID and a GUID?
They are the same thing. GUID is Microsoft's name for a UUID; GUIDs are often shown in uppercase inside braces.
Can two UUIDs ever be the same?
In theory yes, in practice no. You would need to generate billions of version 4 UUIDs per second for many years before a collision became likely.
Are these UUIDs secure?
They come from a cryptographically secure random generator. Even so, do not use a UUID as a password or secret token; use a dedicated token generator with more randomness and proper expiry.
Which version should I use for a database key?
Version 7. It sorts by creation time, which avoids the index fragmentation that random version 4 keys cause.