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
- Category
- Developer & Code
How to use the UUID generator
- Choose how many you need - one for a quick test, or a batch to seed a fixtures file.
- Generate, and the identifiers appear immediately.
- 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
| Version | Built from | Good for |
|---|---|---|
| v1 | Timestamp + MAC address | Sortable, but leaks the machine address and creation time. |
| v3 / v5 | MD5 / SHA-1 of a namespace and a name | Deterministic - the same input always yields the same UUID. Useful for deriving stable IDs from external keys. |
| v4 | Random bytes | The general-purpose default. What this tool produces. |
| v7 | Unix timestamp + random | Random 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.