UUID Generator (Version 4)

A UUID is a 128-bit identifier you can generate anywhere without asking a central authority whether it is taken. That property makes it the default choice for database primary keys in distributed systems, for correlation IDs in logs, and for any identifier that has to be created offline and merged later.

This generator produces version 4 UUIDs - the random kind - using the browser's cryptographic random number source.

Free · runs in your browser · updated

Settings
Count (Amount to generate)
Results

UUID Generator (Version 4) at a glance

What it does
Generate cryptographically random version 4 UUIDs, one at a time or in bulk. Uses the browser crypto API - no server, no logging, no repeated values.
Where it runs
Entirely in your browser — no data is uploaded
Works offline
Yes, once the page has loaded
Cost
Free, with no account and no usage limit

How to use the UUID generator

  1. Choose how many you need - one for a quick test, or a batch to seed a fixtures file.
  2. Generate, and the identifiers appear immediately.
  3. Copy the list straight into your code, migration or spreadsheet.

What the 36 characters mean

A UUID is written as 32 hexadecimal digits in five groups: 8-4-4-4-12, separated by hyphens.

f47ac10b-58cc-4372-a567-0e02b2c3d479
                   ^    ^
                   |    variant (8, 9, a or b)
                   version (4 = random)

The 13th digit is always 4 in a version 4 UUID, and the 17th is one of 8, 9, a or b. Those six bits are fixed, which leaves 122 bits of randomness.

Will two ever collide?

With 122 random bits there are roughly 5.3 × 1036 possible values. To reach a 50% chance of a single collision you would need to generate about 2.7 × 1018 UUIDs. Generating a billion per second, that takes around 85 years.

In practice, the only real risk is a weak random source. A UUID built from Math.random() is not cryptographically random and can repeat far sooner than the maths suggests - this tool uses crypto.getRandomValues() instead.

The other versions, and when they are better

VersionBuilt fromGood for
v1Timestamp + MAC addressSortable, but leaks the machine address and creation time.
v3 / v5MD5 / SHA-1 of a namespace and a nameDeterministic - the same input always yields the same UUID. Useful for deriving stable IDs from external keys.
v4Random bytesThe general-purpose default. What this tool produces.
v7Unix timestamp + randomRandom but time-ordered, which makes it far kinder to database indexes.

UUIDs as database keys

Random primary keys have a real cost. Because v4 values are uniformly distributed, every insert lands in a random spot in the B-tree index, fragmenting pages and pushing the working set out of memory. On a large table this shows up as slowing inserts and a much bigger index than an auto-increment column would produce.

Mitigations, roughly in order of preference: use UUIDv7 or ULID so identifiers are time-ordered; store the value as 16 raw bytes rather than a 36-character string; or keep an internal auto-increment key and expose a UUID only in your API. Exposing sequential IDs publicly leaks how many records you have and invites enumeration, which is the usual reason to reach for UUIDs in the first place.

Frequently asked questions

Not guaranteed by construction - they are random, not coordinated - but the probability of a collision is small enough to ignore for any realistic volume. They are generated with the browser's cryptographic random source, not Math.random().

RFC 4122 says generators should output lowercase and readers should accept either. Some systems - notably parts of the Microsoft ecosystem - display uppercase. Pick one and normalise on input, or you will end up with duplicate rows that differ only in case.

Auto-increment is smaller, faster and naturally ordered - use it when a single database owns the sequence. Choose UUIDs when identifiers must be created offline, merged from several sources, or exposed publicly without revealing record counts.

All zeros: 00000000-0000-0000-0000-000000000000. It is the conventional placeholder for "no value", though a proper null is usually clearer.

No. They are generated in your browser and never transmitted, so nobody - including us - has a record of what you generated.

Nothing you enter here leaves your browser

UUID Generator (Version 4) does its work in JavaScript running on your own device. The page loads once, and after that there is no upload step and no server involved — which matters here because API responses, tokens and configuration files are exactly the kind of thing that should not be posted to someone else’s server for formatting.

You can verify this rather than taking our word for it: load the page, disconnect from the internet, and the tool keeps working. Our privacy policy sets out what is and is not collected, and this guide explains why the distinction matters.