UUID Generator

Generate cryptographically random UUID v4 values.

Output
Result
Options

About this tool


A UUID is a 128-bit identifier designed so that independent systems can generate IDs without coordinating. Version 4 fills 122 of those bits with random data, which makes collisions vanishingly unlikely without any central registry or database sequence.

These are generated by your browser's cryptographic random number generator. Generating them requires no server request, and the generated values are not transmitted or logged by this tool, which is what makes it safe to generate identifiers you intend to use in production.

How to use it

  1. Set the optionsChoose how many values you need and how they should be formatted.
  2. GeneratePress Generate, or use Ctrl+Enter (Cmd+Enter on macOS).
  3. Copy or downloadCopy the result to your clipboard or save it as a file.

Worked examples


Each example below is executed against this tool by the test suite, so what you see is what the tool actually produces.

Three generated UUIDs

Input

Output

f47ac10b-58cc-4372-a567-0e02b2c3d479
7c9e6679-7425-40de-944b-e07fc1f90ae7
16fd2706-8baf-433b-82eb-8c7fada847da

Note the 4 starting the third group in each. That is the version marker, not randomness.

What to watch for


The details that decide whether a conversion is correct, and where information can be lost without any error being raised.

What the format means
The canonical form is 8-4-4-4-12 hexadecimal digits separated by hyphens. Two positions are fixed rather than random: the first digit of the third group is always 4, marking the version, and the first digit of the fourth group is 8, 9, a or b, marking the RFC 4122 variant. The remaining 122 bits are random.
Collision probability in practice
122 random bits means about 5.3 × 10^36 possible values. You would need to generate roughly 2.7 × 10^18 UUIDs before reaching a 50% chance of a single collision, around a billion per second for 85 years. For any realistic application, treating v4 UUIDs as unique is sound.
Cryptographic randomness matters
These come from crypto.getRandomValues(), not Math.random(). That distinction is important: Math.random() is not cryptographically secure and its output can be predicted from previous values, which would make identifiers guessable. Never use Math.random() for anything that acts as a capability or token.
Why v4 is not ideal as a database key
Random UUIDs have no ordering, so inserting them into a B-tree primary key scatters writes across the index and fragments it. That is why UUIDv7, which prefixes a timestamp to keep values roughly sortable, is now preferred for new database schemas. Version 4 remains the right choice for public identifiers, where you specifically do not want creation time to be inferable.
Format variations
Hyphens, uppercase and brace-wrapping are all cosmetic, the same 128 bits. Braces are the Microsoft GUID convention, and the hyphenless 32-character form is common in URLs and database columns.

Limitations


  • Generates version 4 (random) UUIDs only, not v1, v5 or v7.
  • Capped at 1,000 values per run to keep the browser responsive.

Questions


Are these safe to use in production?
Yes. They come from your browser's cryptographic RNG, which is the same source a server-side library would use. The generated UUID values are not transmitted or logged by this tool, so using it does not share those values with anyone else.
Should I use v4 or v7?
Use v7 for database primary keys, because its timestamp prefix keeps inserts sequential and the index compact. Use v4 for public identifiers, where you do not want creation time to be derivable from the ID.
Can two UUIDs ever collide?
In principle yes, in practice no. Reaching a 50% collision chance requires on the order of 10^18 UUIDs. Hardware failure is far more likely than a v4 collision.
Is the 4 in every UUID a sign they are not random?
No, that digit is the version marker defined by RFC 4122. Only the two most significant bits of the variant digit are fixed to binary 10, so that digit can be 8, 9, a or b. The other 122 bits are fully random.