Skip to content
WGX

UUID Generator

Generate version 4 or version 7 UUIDs from your browser’s cryptographic randomness.

Version
Written as

Made in your browser with crypto.getRandomValues, the same source a password manager uses. Never Math.random, which is seeded and predictable.

Where the randomness comes from

A UUID is only as unique as the randomness behind it, and this is the part almost no generator mentions. These are made with crypto.getRandomValues — the browser's cryptographic generator, the same one a password manager uses. The alternative, Math.random, is seeded, predictable, and on some engines repeats: it produces values that look exactly like UUIDs and are not reliably unique. If a generator does not say which it uses, you cannot tell by looking at the output.

Version 4 and version 7

Version 4 is 122 random bits with the version and variant fields written in. It is the one everyone knows, and it is in no particular order.

Version 7 — standardized in RFC 9562 — puts the current time in milliseconds into the first 48 bits, a counter in the next 12 so a batch made within one millisecond sorts in the order it was made, and 62 random bits after that. It is unique for any practical purpose, and it sorts by when it was made, as text and as bytes. That matters more than it sounds: a random primary key scatters every insert to a different page of a database index, and a time-ordered one appends to the end. If these identifiers are going to be keys, v7 is usually the better answer.

Are they actually unique?

Version 4 has about 5.3 × 1036 possible values. To reach a 50% chance of a single collision you would need to generate roughly a billion a second for about eighty-six years. In practice the failure mode is never the mathematics — it is a generator using weak randomness, or the same seed twice.

Braces, capitals and missing hyphens

The value is sixteen bytes; everything else is convention. Microsoft tooling writes GUIDs in braces and upper case, some databases store the 32 digits without hyphens, and most of the web uses lower case with hyphens. All three switches are on the panel, and none of them changes what the identifier is.

Nothing is sent

The identifiers are made on your machine and stay there; the test suite for this page watches what the generator asks the network for and fails if any of it could carry them. A generator that makes them on a server has seen every value it gave you, which is worth thinking about before one of them becomes an access key.

Questions

How do I generate a UUID?

There are five on the page already — it generates as soon as it opens. Change the version or the number and it makes new ones; the formatting switches rewrite the same ones. Press Generate again for a fresh batch.

What is the difference between UUID v4 and v7?

Version 4 is 122 random bits: unique, and in no particular order. Version 7 puts the current time in milliseconds at the front, a counter after it so a batch made within one millisecond keeps its order, and 62 random bits after that, so identifiers made later sort after ones made earlier. Both are unique for any practical purpose; v7 is much kinder to a database index, because random keys scatter every insert across the whole tree.

Are these UUIDs really unique?

For practical purposes, yes. Version 4 has 122 random bits, which is about 5.3 × 10^36 values; you would have to generate a billion a second for 85 years before a collision became likely. The uniqueness depends entirely on the randomness being real, which is why this page uses the browser’s cryptographic generator and says so.

Is it safe to generate UUIDs on a website?

It depends where they are made. Here they are made in your browser and never sent anywhere, so nobody else has seen them. A generator that produces them on a server has a record of every value it handed out — which matters if you were about to use one as anything more than a name.

Can I use a UUID as a secret or a password?

A version 4 UUID has 122 bits of randomness, which is plenty of entropy, but it is designed to be shown rather than hidden and is often logged, put in URLs and shared. If you need a secret, generate a secret. If you need a name that will not collide, this is exactly the right tool.

Why do some systems want braces or no hyphens?

Convention. Microsoft tooling has long written GUIDs in braces and upper case; some databases and file naming schemes store the 32 hexadecimal digits with no hyphens at all. The value is identical in every case — only the writing changes — so all three switches are here.

  • JSON Formatter

    Make JSON readable, make it small, or find out exactly what is wrong with it.

  • Password Generator

    Generate a strong password from your browser’s cryptographic randomness. Nothing is sent anywhere.

  • Random Number Generator

    Draw a number, or several without repeats, from your browser’s cryptographic randomness rather than a source anyone can anticipate.