Dev Explained

What Is a UUID? (And Is a GUID the Same Thing?)

If you've ever seen an ID like f47ac10b-58cc-4372-a567-0e02b2c3d479 attached to a file, a database record, or an order confirmation, you've run into a UUID.

In short: a UUID (Universally Unique Identifier) is a 128-bit ID written as 32 hex characters in five groups, likef47ac10b-58cc-4372-a567-0e02b2c3d479. It is generated from random data rather than handed out by a central counter, so two systems can mint IDs independently and (practically) never collide. A GUID is Microsoft's name for the same thing.

What a UUID actually is

UUID stands for Universally Unique Identifier. It's a 128-bit number, almost always written as 32 hexadecimal characters split into five groups by dashes, used to label something, a file, a database record, a session, a device, in a way that's extremely unlikely to ever collide with another ID generated anywhere else, by anyone else, at any other time. GUID, short for Globally Unique Identifier, is Microsoft's own name for essentially the same concept. In practice, the two terms get used interchangeably, and a guid generator and a uuid generator almost always produce the exact same kind of value.

Why not just count 1, 2, 3

Simple incrementing numbers work fine when a single system is entirely in control of assigning them. The moment you have multiple databases, multiple servers, or offline devices that need to generate IDs independently without checking in with each other first, sequential numbers fall apart, since two different sources can easily assign the same number to two different things. A UUID solves this by being random enough that any two systems generating IDs completely independently, without ever communicating, still won't produce the same value in any realistic scenario. That property is exactly what makes UUIDs useful across distributed systems, offline-first apps, and merging data from separate sources without worrying about ID clashes.

How unlikely is a collision, actually

A standard random UUID has enough possible combinations that you could generate billions of them every second for centuries and still have a vanishingly small chance of ever generating the same one twice. This is why UUIDs are trusted as unique identifiers without needing a central authority to check and approve each one before it's used, unlike something like a username, which does need to be checked against existing ones.

What "UUID4" and the version number actually mean

UUIDs come in a few different versions, and the number after the word UUID refers to how it was generated. UUID version 4, which is what most people mean when they ask for a uuid4 generator or simply a random UUID, is generated using random or pseudo-random data alone. Older versions, like version 1, incorporate the generating device's network information and the current timestamp, which technically makes them unique too, but can leak details about when and where the ID was created. Because of that, version 4 is the practical default for the vast majority of everyday use cases, which is exactly why nearly every modern uuid generator produces version 4 values unless you specifically ask for something else.

Where UUIDs actually show up

  • Primary keys in databases, especially ones spread across multiple servers.
  • Session identifiers and API keys, since they're unpredictable and hard to guess.
  • File names for uploads, avoiding collisions when many users upload files with the same original name.
  • Tracking individual requests or transactions through a system for debugging and logging.
  • Uniquely identifying devices, installations, or configuration entries.

What a UUID looks like, and how to read it

A standard UUID looks like this: f47ac10b-58cc-4372-a567-0e02b2c3d479. It's 32 hexadecimal characters, arranged in five groups separated by dashes, in the pattern 8-4-4-4-12. One small but occasionally useful detail: in a version 4 UUID, the first character of the third group is always the digit 4, which is how you can visually confirm you're looking at a version 4 UUID rather than another version, without needing any special tool.

Generate a UUID online, without writing any code

You don't need to write a single line of code to get a valid UUID. Modern browsers can generate cryptographically random UUIDs natively, which is exactly what a good online UUID generator relies on behind the scenes, meaning the value is generated instantly and privately on your own device rather than being requested from somewhere else.

You can try this directly with the free UUID / GUID generator on this site. Generate a single ID or up to a hundred at once, with options to switch to uppercase or remove the dashes if your project expects a different format, all processed locally in your browser.

A few things beginners often get wrong

  • Assuming a UUID guarantees absolute uniqueness. It's astronomically unlikely to collide, not mathematically impossible, though for practical purposes that distinction essentially never matters.
  • Using an older, timestamp-based UUID version when a random version 4 UUID would have been simpler and more private.
  • Treating a UUID as a security measure by itself. It's unpredictable, which makes it hard to guess, but it isn't the same as encryption or authentication.
  • Manually typing or editing a UUID by hand, which is exactly how a stray character error creeps in. Generating and copying it directly avoids that entirely.

UUID vs GUID: is there a difference?

In everyday use, no. UUID is the term from the open standards world (defined by RFC 9562, originally RFC 4122, and going back to the OSF's distributed computing work); GUID, Globally Unique Identifier, is the name Microsoft gave the same 128-bit format in Windows and .NET. A GUID and a UUID are written identically, generated the same way, and can be used interchangeably as text: an ID minted by a guid generator will be accepted anywhere a UUID is expected, and vice versa.

There is exactly one practical gotcha, and it only appears at the byte level. .NET's Guid type stores the first three fields little-endian in its byte-array form, while the standard text form is big-endian, so the raw bytes of the "same" ID can differ between a .NET byte array and another system's bytes even though the dashed text matches perfectly. If you only ever store and compare the text form, which is what databases, URLs and JSON all do, you will never run into it.

The bottom line

A UUID, or GUID under Microsoft's naming, is simply a long random value designed to be unique enough that no two systems generating one independently will ever realistically produce the same result. That's the whole idea, no central coordination required, no collisions to worry about in practice. Whenever you need an ID that just works without a database checking it first, a random UUID is almost always the simplest, safest choice.

Frequently asked questions

What does UUID stand for?

Universally Unique Identifier. The name is the design goal: an identifier that any system can generate on its own and still be, for all practical purposes, unique in the universe of other UUIDs.

What is a UUID, and is it the same as a GUID?

A UUID is a 128-bit identifier written as 32 hexadecimal characters in five groups. GUID is the name Microsoft uses for the same thing.

Can two UUIDs ever be the same?

In theory yes, in practice no. For randomly generated version 4 UUIDs, the chance of a collision is so small that it is ignored in real systems.

What does UUID version 4 mean?

Version 4 means the UUID is built from random data rather than from your device or the current time. It is the version most modern systems use.

Why use a UUID instead of an auto-incrementing ID?

UUIDs can be created anywhere without checking a central counter, and they are hard to guess. Auto-incrementing IDs are shorter and simpler but reveal how many records exist and need one place to hand out numbers.