UUIDs and GUIDs Explained: Formats, Versions, and When to Use Them

Runs 100% in your browser — nothing on this page is uploaded or stored. Strings like 6f1e9b2a-4c3d-4e5f-8a7b-9c0d1e2f3a4b show up in databases, APIs, config files, and URLs everywhere. They're UUIDs — and this guide explains what they are, how the versions differ, what a GUID is, and the practical rules for when to reach for one (and when not to).

What a UUID is

A UUID (Universally Unique Identifier) is a 128-bit identifier, standardized in RFC 4122 and updated by RFC 9562. The "universally unique" part is the whole point: the identifier is designed so that anyone, anywhere, can generate one without checking with anyone else, and the chance of two people generating the same one is so small it's not worth worrying about.

The standard text format is 32 hexadecimal digits in five groups separated by hyphens — the famous 8-4-4-4-12 pattern:

xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (36 characters including hyphens)

Hex digits are case-insensitive, but lowercase is the convention — you'll see 6f1e9b2a-… far more often than 6F1E9B2A-…. If you're normalizing a list of mixed-case UUIDs (from logs, exports, or API responses), our case converter will lowercase them all in one pass.

UUID vs GUID: what's the difference?

GUID (Globally Unique Identifier) is Microsoft's term for the same concept. In practice, a GUID is a UUID — specifically, Microsoft's implementation historically followed the version-4 (random) layout with a particular byte ordering. If someone asks for a "GUID generator" and someone else asks for a "UUID generator," they need the same thing: a 128-bit random identifier in the 8-4-4-4-12 format. The two terms are interchangeable in everyday developer conversation.

The versions, and which one you actually want

The third group's first digit encodes the version — how the UUID was generated. The common ones:

The practical rule: use version 4 unless you have a reason not to; use version 7 if the IDs will be database keys at scale; use version 5 when you need the same input to always produce the same ID.

How unique is "universally unique," really?

A version-4 UUID has 122 random bits, which means 2122 — about 5.3 × 1036 — possible values. The collision math is the birthday problem: you'd need to generate roughly 2.7 quintillion (2.7 × 1018) UUIDs before reaching even a 50% chance of a single duplicate. At a billion UUIDs per second, that takes about 85 years.

One honest caveat: this assumes a good random source. UUIDs generated from a weak pseudorandom generator (or a broken one) can collide far more often. In the browser, crypto.randomUUID() uses the operating system's cryptographic randomness — the same kind our password generator relies on — so it's sound. A UUID built from Math.random() is not a real v4 UUID and shouldn't be treated as one.

When to use UUIDs

When NOT to use them

Formatting and validating UUIDs

A few practical notes that save debugging time:

Frequently asked questions

What does UUID stand for?

Universally Unique Identifier — a 128-bit identifier standardized in RFC 4122 (updated by RFC 9562), designed so anyone can generate one independently with a negligible chance of duplication.

Is a GUID the same as a UUID?

Effectively yes. GUID (Globally Unique Identifier) is Microsoft's term for the same 128-bit identifier format. In everyday use the terms are interchangeable, and a GUID generator and a UUID generator produce the same thing.

Can two UUIDs be the same?

In theory, yes; in practice, no. A version-4 UUID has 122 random bits, and you'd need to generate about 2.7 quintillion of them to reach even a 50% chance of one collision. With a proper random source, duplicates are not a realistic concern.

Which UUID version should I use?

Version 4 (random) is the safe default for general use. Use version 7 (time-ordered) for database primary keys at scale, since chronological ordering keeps indexes efficient. Use version 5 (name-based) when the same input must always produce the same UUID.

Are UUIDs case-sensitive?

The hex digits are case-insensitive — uppercase and lowercase forms represent the same UUID. Lowercase is the convention. Always normalize case before comparing UUIDs as strings, or 6F1E… won't match 6f1e….

How do I generate a UUID in JavaScript?

Use the built-in crypto.randomUUID() — it returns a proper version-4 UUID using the browser's cryptographic randomness, with no libraries needed. Avoid hand-rolling one from Math.random(), which is not cryptographically secure.

Tidy up your identifiers

Working with batches of UUIDs? Normalize their case, clean up pasted lists — free, instant, and everything stays in your browser.