If you've seen an ID like 550e8400-e29b-41d4-a716-446655440000 in a database or API response, that's a UUID. Here's what it is, why it looks that way, and when it's the right choice for identifying something.
What a UUID is
UUID stands for Universally Unique Identifier — a 128-bit value, usually written as 32 hexadecimal characters split into five groups (8-4-4-4-12). It's generated using a mix of randomness (and sometimes a timestamp, depending on the version) designed so that two different systems, generating UUIDs independently, are extremely unlikely to ever produce the same one.
Why not just use a normal counter like 1, 2, 3?
Sequential IDs are simple, but they leak information and don't scale well across independent systems:
- They reveal how many records exist (and let anyone guess neighboring IDs, like
/orders/1002). - Two separate databases generating IDs independently — for example, before merging data or syncing offline — will produce clashing numbers.
- They require a central counter, which becomes a bottleneck in distributed systems.
A UUID can be generated anywhere, by anyone, with no coordination, and still be safe to use as a unique identifier.
The different UUID versions, briefly
- Version 4 is the most common — almost entirely random. This is what most general-purpose UUID generators (including ours) produce.
- Version 1 encodes the current timestamp and network information, which can unintentionally leak details about when and where it was generated.
- Newer versions like UUID v7 are timestamp-ordered, useful when you want IDs that sort roughly by creation time.
For most everyday use cases — database primary keys, session tokens, file names — version 4 is the standard, sensible choice.
When you should use a UUID
- Public-facing resource IDs (CLAUDE.md's own rule: avoid exposing sequential IDs publicly).
- Distributed systems where multiple services generate IDs independently.
- Temporary identifiers like session tokens or request IDs.
When a UUID is overkill
For a small internal table only your own code touches, a simple auto-incrementing number is often simpler and takes less storage. Reach for a UUID when uniqueness needs to hold across systems, not just within one table.
How to generate a UUID
Open the UUID Generator, pick how many you need, and copy the result. Generation happens entirely in your browser.
FAQ
Can two UUIDs ever collide? In theory, yes — but the probability is astronomically small for version 4 UUIDs, to the point where it's not a practical concern for virtually any application.
Is a UUID the same as a GUID? Yes, in practice. GUID (Globally Unique Identifier) is Microsoft's name for the same concept and format.
Generate a UUID now
Try the free UUID Generator — no sign-up, nothing leaves your browser. See more developer tools for related utilities.
Related reading
Browse the full blog for more developer guides.
