UUID Generator
Generate version 4 or version 7 UUIDs in your browser, one or a hundred at a time, with no request.
Options
Version 7 embeds a millisecond timestamp in the first 48 bits, so the values sort by creation time. Version 4 is pure randomness.
UUIDs
0 generated in this tab with crypto.getRandomValues. Nothing is uploaded.
Generating…
Saving needs a Dex account. The tool never does.
How it works
- Choose how many identifiers you need and whether you want version 4 or version 7. They are generated immediately, and again whenever you change either setting.
- Version 4 is 122 random bits with the version and variant bits set. Version 7 puts a millisecond timestamp in the first 48 bits and fills the rest with randomness, so the values sort by creation time as plain strings.
- Randomness comes from crypto.getRandomValues, the browser cryptographic source, not Math.random.
- Nothing is sent anywhere. Generating a key for a database migration on a locked-down machine is the same as generating one on a laptop.
Examples
Primary keys that sort by time
Version 7 gives you an identifier that is unique like a UUID but sorts chronologically, which keeps B-tree inserts near the end of the index instead of scattering them.
A throwaway identifier for a test fixture
Five version 4 values, copy all, paste into the fixture. The values are random and never reused.
Frequently asked questions
Which version should I use?
Version 7 for anything stored in a database, because it sorts by creation time. Version 4 when you only need uniqueness and do not care about ordering.
Are these UUIDs unique?
Version 4 has 122 random bits. You would need to generate billions per second for decades before a collision became likely. Version 7 adds a timestamp, so collisions need the same millisecond and the same random tail.
Are they generated securely?
Yes. The values come from the browser cryptographic random source. This is the same source used for session tokens, so it is suitable for identifiers, though a UUID is not a secret.
Is there a batch limit?
One hundred per click here. That is a display limit rather than a technical one: copying thousands of lines out of a textarea is rarely useful.