UUID Generator

Generate version 4 UUIDs using the browser's cryptographic random number generator, in bulk and in several output formats.

Loading tool…

UUIDs are generated on your device with crypto.getRandomValues(). Nothing is requested from or sent to a server.

What the UUID Generator does

This UUID generator will generate version 4 UUIDs using the browser's cryptographic random number generator, in bulk and in several output formats. Everything runs inside this page, so the work happens on your own device rather than on a server. It is most often used for creating primary keys for records generated across several services. If you need the other side of this job, there is also a regex tester.

How to use it

  1. Choose how many UUIDs you need.
  2. Pick a format — plain, uppercase, braced or as a quoted list.
  3. Click generate for a fresh batch.
  4. Copy all of them with one button, or download as a text file.

How it works

Version 4 UUIDs are 122 bits of random data with 6 bits fixed to identify the version and variant. Randomness comes from crypto.getRandomValues(), the browser's cryptographically secure generator, not Math.random() — which is predictable and must never be used where uniqueness or unguessability matters.

The collision probability is negligible in practice. You would need to generate around 2.7 × 10^18 UUIDs before reaching a 50 per cent chance of a single collision, which is why distributed systems can mint identifiers independently without coordinating.

Version 4 is the right default for most uses. Version 1 encodes a timestamp and MAC address, which leaks information and has been a real privacy problem. Version 7, standardised in 2024, prefixes a timestamp while keeping the rest random, which sorts chronologically and indexes better in databases — worth considering if you are choosing a primary key type.

When to use it

  • Creating primary keys for records generated across several services.
  • Generating correlation IDs for request tracing.
  • Producing unique filenames or test fixtures.

Common mistakes to avoid

  • Using a UUID as a security token without checking it came from a cryptographic source.
  • Storing UUIDs as text in a database where a native UUID or binary column would be far smaller and faster to index.
  • Choosing version 1, which embeds a timestamp and network address.

Frequently asked questions

Are these random enough to be unguessable?

Yes. They use crypto.getRandomValues(), the same generator the browser uses for cryptographic work. The 122 random bits make guessing infeasible.

Should I use UUID v4 or v7?

v4 for general identifiers. v7 if the identifier is a database primary key and insert performance matters — its timestamp prefix keeps inserts sequential, which avoids index fragmentation that random v4 keys cause.

What is the chance of a duplicate?

Negligible. Reaching a 50 per cent chance of one collision requires roughly 2.7 billion billion UUIDs. For any realistic volume, treat them as unique.

Related tools

See all developer tools →