UUID Generator

What a UUID is

A 128-bit identifier that can be created anywhere, by anyone, without asking a central authority whether it is taken — which is exactly why distributed systems use them. Version 4, the kind generated here, is almost entirely random.

Reading the shape

A UUID looks like xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx. The 4 is the version, and y is always 8, 9, a or b. Everything else is random, so 122 of the 128 bits carry the uniqueness.

Where they are used

  • Database keys that must be generated before the row reaches the server.
  • Request and trace identifiers in logs.
  • File and upload names that must not collide.
  • Idempotency keys, so a retried payment is not charged twice.

Share this tool with friends

Free to use, no sign-up, works on any phone.

Frequently Asked Questions

Can two UUIDs ever be the same?

In theory yes, in practice no. A v4 UUID has 122 random bits; you would need to generate billions per second for decades before a collision became likely. It is safe to treat them as unique.

Where does the randomness come from?

From crypto.getRandomValues, the browser's cryptographic random source — the same one used for keys. Math.random is not used, because its output is predictable enough to be unsuitable.

What do the fixed characters mean?

The 4 at the start of the third group marks the version, and the first character of the fourth group is always 8, 9, a or b. Those bits identify the format, so only 122 of the 128 bits are random.

Should I use a UUID as a database primary key?

It works and removes any need for coordination between servers, but a random UUID scatters index writes and is larger than an integer. If write throughput matters, look at a time-ordered id such as UUIDv7 or ULID.

Are UUID and GUID the same thing?

Yes. GUID is Microsoft's name for it, which is why you often see it wrapped in braces. Both are the same 128-bit value.

Everything on this page runs inside your own browser. Nothing you type or upload is sent to a server, so your data never leaves your device.