Skip to content
ToolShelf

UUID generator

Generate UUIDs in bulk, either random version 4 or time-ordered version 7, using the browser's cryptographic random source and formatted however your code needs them.

What to generate

Version

Every value stays in this tab. The work is done by JavaScript in your browser. None of it is uploaded, logged or saved, and the tool keeps working with the network off.

How to write them

Format

Changing this reformats the values above rather than replacing them.

0 UUIDs

Press Generate and they appear here, one per line.

Where the randomness comes from

From your browser, through crypto.getRandomValues, the same source a password manager draws on. Nothing is requested from a server, so no value on this page has ever existed anywhere else, which is not something a generator that produces UUIDs server-side can say.

If that source is unavailable, the tool produces nothing and says why. It never falls back to Math.random, whose internal state can be recovered from a handful of outputs. That matters because a predictable UUID is indistinguishable from a good one by looking at it: if UUIDs are guarding unlisted URLs or acting as idempotency keys, a weak source is a vulnerability nobody will notice.

Version 4 against version 7

Version 4 is 122 random bits and six fixed ones marking the version and variant. It carries no information at all beyond being unique, which is usually exactly what is wanted.

Version 7, standardised in RFC 9562, puts a 48-bit millisecond timestamp at the front and fills the remainder with randomness. Two consequences follow. They sort chronologically as plain strings, which makes them far kinder to a database index, random keys scatter through a B-tree and fragment it, while ordered keys append. And they disclose roughly when they were created, which is occasionally more than you want to give away.

The ordering is to the millisecond and no finer. A batch generated in one go shares a timestamp, so those values are in no particular order among themselves. You will see that above if you generate several at once. RFC 9562 offers an optional counter for keeping same-millisecond values ordered; it is not implemented here, because it only helps a single generator and gives nothing across several machines.

What is not here, and why

Version 1 embeds the MAC address of the machine that generated it. A browser cannot read one, so generating a version 1 UUID here would mean fabricating that field, producing a value that claims to identify a machine and does not. Version 6 has the same problem.

Versions 3 and 5 are not generated at all; they are hashes of a name inside a namespace, so they are derived from inputs you would have to supply. A button that produced one without asking would be producing a hash of nothing.

Unguessable is not the same as secret

A version 4 UUID is safe to use where guessing it must be infeasible: an unlisted share link, an idempotency key, a correlation ID. It is not an authentication token. Anyone who comes by one, from a log file, a referrer header, a screenshot, keeps it, and unlike a session token it cannot meaningfully be rotated. Treat it as a name that is hard to guess rather than as a credential.

Questions

Are these UUIDs generated on a server?
No. They are made in your browser by crypto.getRandomValues, the same source a password manager uses. Nothing is requested and no value is logged or stored, so no one else has ever seen the UUIDs you are looking at, which would not be true of a generator that produced them server-side.
What is the difference between version 4 and version 7?
Version 4 is 122 random bits with no structure, so two made a second apart are unrelated. Version 7 starts with a 48-bit millisecond timestamp and fills the rest with randomness, so they sort into the order they were created, to the millisecond. A batch generated in the same millisecond shares a timestamp and is unordered within itself. Both are equally unguessable in practice; version 7 simply carries its creation time as well.
Which one should I use for a database primary key?
Version 7, generally. Random keys land at arbitrary points in a B-tree index, which fragments it and makes inserts progressively slower on a large table; time-ordered keys append to the end. Version 7 also gives you an approximate creation time for free. The trade-off is that it reveals roughly when a row was made, which is occasionally something you would rather it did not.
Could two of these ever collide?
Not in any practical sense. A version 4 UUID has 122 random bits, about 5.3 x 10^36 possibilities. You would need to generate a billion a second for about 85 years to reach a 50% chance of a single duplicate anywhere. The realistic risk is not the mathematics but a weak random source, which is why this tool refuses to run without a cryptographic one.
Why can I not generate a version 1 UUID here?
Version 1 embeds the network card address of the machine that created it, and a browser cannot read one. Producing a version 1 UUID here would mean inventing that field, giving you a value that claims to identify a machine and does not. Versions 3 and 5 are missing for a different reason: they are hashes of a name you supply, so they are derived rather than generated.
Is a UUID secret?
Treat it as unguessable, not as secret. A version 4 UUID is fine as an unlisted URL or an idempotency key, because guessing one is infeasible. It is not a substitute for authentication: anyone who obtains it, from a log, a referrer header, a shared link, has it for good, and it cannot be rotated the way a token can.
Does the format change the value?
No. Uppercase, braces, the URN prefix and removing the hyphens are all ways of writing the same 128 bits, and every system that accepts UUIDs accepts the standard lowercase form. Changing the format here reformats the values you already have rather than generating new ones.
How many can I generate at once?
Up to a thousand, which is enough to seed a test table and few enough that the page stays responsive. They come out one per line, so the copy button gives you something you can paste straight into a SQL insert, a fixture file or a spreadsheet column.

More tools