UUID v4 Generator

Random version 4 UUIDs, generated when the page opens.

Runs entirely in your browser

Loading the tool…

Version 4 UUIDs, generated when the page opened. They are the ordinary kind: 122 random bits with six fixed to mark the version and variant, written as thirty-two hex digits in five dash-separated groups.

Being entirely random is the point and also the cost. Nothing about a v4 is derived from the time, the machine or anything else, so it leaks nothing and needs no coordination between whatever is generating them. But successive ids land nowhere near each other, which is why a v4 primary key fragments a B-tree index: every insert goes to a random page and the table stops being written sequentially.

On a large table with heavy inserts that is a real cost, and it is what version 7 exists to fix, keeping the randomness but ordering by time. For short ids in the same spirit, there is ULID.

Microsoft calls the same format a GUID. There is no difference worth caring about: a GUID in modern use is a UUID, usually written in braces.

How to use it

  1. Read the ids above, generated when the page opened.
  2. Press Generate for a fresh set, or change the count first.
  3. Press Copy to take them, with braces or quotes if you need them.

Questions

What is the chance of two UUID v4s colliding?

Negligible for any real workload. With 122 random bits you would need to generate on the order of a billion a second for decades before a collision became likely. It is not impossible, only far less likely than the failures you already accept without insuring against.

Should I use a UUID v4 as a database primary key?

Only with the index cost in mind. Because the values are unordered, every insert lands on a random page of the index and the write pattern stops being sequential, which fragments the tree and hurts on large, insert-heavy tables. Version 7 gives you the same uniqueness with time ordering.

Is a GUID the same as a UUID?

In practice yes. GUID is Microsoft's name for the same 128-bit format, usually written inside braces. The tick box above adds those braces if the system you are pasting into expects them.

Are these generated on my machine?

Yes, in this tab, from the browser's cryptographic random source. Nothing is requested from a server and nothing is recorded, so no ids you generate here exist anywhere but on your screen. The page works with the network off.

Could two people get the same id?

Not in any practical sense for the random kinds. The space is large enough that collisions are a theoretical concern rather than an operational one, and no coordination between generators is needed, which is the entire reason these formats exist.

The other formats

The same generator on a different kind of identifier, and what separates them.

Your data stays on your device

Everything above runs inside your browser as WebAssembly compiled from Rust. Nothing you type is uploaded, logged or stored on a server. You can load this page once, go offline, and it still works.

This page makes no requests at all, to anywhere. That is not a promise in the copy: it is a Content-Security-Policy header your browser enforces, and connect-src on it is none. Open the network tab and watch nothing happen.