What Is a UUID? Explained Simply (With Examples and Versions)

Short answer: A UUID is a 128-bit number, written as a 36-character string, that gives anything — a database row, a file, an API request — a practically unique ID. Any computer can create one on its own, without asking a central server for permission, and the chance of two UUIDs ever colliding is so tiny that systems simply treat them as unique. UUID stands for Universally Unique Identifier.

If you have ever opened a database, read an API response, or looked at a long string like f47ac10b-58cc-4372-a567-0e02b2c3d479 and wondered what it was, you were looking at a UUID. This guide answers what is UUID explained simply — no computer science degree needed — with real examples, the different versions, and the places you will meet UUIDs in everyday software.

What Is a UUID, Explained Simply?

Think of a UUID as a name tag that is printed once and never printed again. Imagine a factory that makes name tags for every parcel in the world. Instead of keeping one big list and handing out numbers one by one (1, 2, 3, and so on), the factory gives every machine its own way of printing a tag so random that no two machines will ever print the same one by accident.

That is exactly what a UUID does for software. A UUID (Universally Unique Identifier) is a 128-bit value used to label one thing — a user account, an order, a photo, a payment — so that it can be told apart from every other thing, on every computer, without any coordination. The official standard is RFC 9562, published in 2024, which replaced the older RFC 4122.

The key idea is independence. Two phones with no internet connection can each create a UUID, and when they later sync to the same server, their IDs will still not clash. An auto-increment counter (1, 2, 3, and so on) can only promise that if one single database hands out every number. UUIDs remove that bottleneck, which is why distributed systems, mobile apps, and APIs rely on them.

What Does a UUID Look Like?

A UUID is almost always shown as a string of 36 characters: 32 hexadecimal digits (the numbers 0–9 and the letters a–f) split into five groups by four hyphens, in an 8-4-4-4-12 pattern. Here is a real example:

f47ac10b-58cc-4372-a567-0e02b2c3d479

Each part carries meaning:

  • The first three groups hold the time-based or random data, depending on the version.
  • The first digit of the third group tells you the version — here it is 4, so this is a version 4 UUID.
  • The first digit of the fourth group is the variant marker. In standard UUIDs it is always 8, 9, a, or b — here it is a.
  • The last group is 12 hex digits of random (or node-based) data.

UUIDs are case-insensitive, so F47AC10B-58CC-4372-A567-0E02B2C3D479 is the same ID as the lowercase version. Lowercase is the usual convention, and most tools generate lowercase by default.

Why Do We Need UUIDs?

Counting 1, 2, 3 works fine on one computer. It breaks the moment many computers create records at the same time:

  • Two servers, one number: If two servers both hand out "order #1042", the database now has two different orders with the same ID. Merging them becomes a mess.
  • Offline first: A mobile app that works without internet must create records now and sync later. It cannot wait for a server to assign a number.
  • No single point of failure: If the one machine that hands out numbers goes down, nothing can be created. UUIDs let every machine generate IDs locally.
  • Harder to guess: Sequential IDs leak information — anyone can guess that order #1043 exists. A random UUID reveals nothing about how many records exist.

This is the problem UUIDs were designed to solve: unique names without a central authority, at any scale, on any device.

UUID Versions at a Glance

The standard defines several versions. You do not need all of them — in practice, two cover almost every job.

VersionHow it is madeBest for
v1Timestamp + device addressLegacy systems; reveals time and device, so rarely used in new projects
v3MD5 hash of a name + namespaceSame name always gives the same ID
v4122 random bitsAlmost everything — the everyday default
v5SHA-1 hash of a name + namespaceSame name always gives the same ID, more secure than v3
v7Unix timestamp in milliseconds + random bitsDatabase keys — sorts by creation time, the modern recommendation

If you are unsure, pick version 4 for general use and version 7 when the ID will be a database primary key, because time-ordered IDs keep new rows grouped together and make database indexes faster. Our free UUID generator tool creates version 4 UUIDs in one click, including in bulk when you need a whole list for test data.

Where Are UUIDs Used?

Once you know what to look for, you will spot UUIDs everywhere:

  • Database primary keys: Each row — a user, a product, an order — gets a UUID instead of a counting number, so records created on different servers merge cleanly.
  • API requests: When a payment app talks to a server, it can attach a fresh UUID to the request. If the network stutters and the same request arrives twice, the server spots the repeated ID and processes the payment just once. APIs also return UUIDs as resource IDs — see our guide on how to format a JSON API response to read them comfortably.
  • Files and uploads: Cloud storage renames uploaded files to a UUID so two users uploading photo.jpg never overwrite each other.
  • Sessions and devices: Apps and browsers store a UUID as a session or installation ID, and Bluetooth devices advertise UUIDs to identify their services.
  • Event tracking: Analytics and logging systems tag every event with a UUID, so a single user journey can be followed across services.

UUID vs GUID: Same Thing Under a Different Name?

Almost none. Microsoft calls this same 128-bit format a GUID (Globally Unique Identifier). Whether the ID comes from Windows or from Linux, it follows one shared format and one shared RFC, so the two terms can be swapped freely. In short: "GUID" in Microsoft's docs and "UUID" everywhere else mean the same thing.

UUID vs Auto-Increment ID: Which Should You Use?

UUIDAuto-increment (1, 2, 3, …)
Works offlineYes — any device can create oneNo — needs the central database
Merging dataEasy, no clashesNeeds remapping
ReadableNo — 36 random-looking charactersYes — short and human-friendly
Storage16 bytes (128 bits)4–8 bytes
GuessablePractically noYes — just add 1

Use auto-increment IDs for small, single-database projects where short, readable IDs matter. Use UUIDs whenever data is created on many machines, synced from offline devices, or exposed in URLs and APIs. For most modern apps, UUIDs are the safer default.

Can Two UUIDs Ever Be the Same?

In theory, yes — the supply is enormous, not endless. In practice, the risk is so small that no working system plans around it. A version 4 UUID draws on 122 random bits, giving about 2122 possible values. The math of random draws says you would need to mint roughly 2.7 quintillion IDs — 2,700,000,000,000,000,000 of them — before the chance of a single repeat even reaches fifty-fifty. At a million new IDs every second, that would take close to 86,000 years. Engineers therefore call UUIDs "practically unique": a repeat is not ruled out by the math, but it sits so far outside real life that software simply builds as if it will never happen.

Are UUIDs Secret? Common Mistakes to Avoid

  • Do not use a UUID as a password or security token. A UUID is hard to guess, but it is not a secret — it is an identifier. Anyone who sees it can reuse it, so never treat it as proof of identity. Use proper authentication tokens instead.
  • Do not assume a UUID is random in every version. The first version stamps its birth details into the ID itself — the clock reading at the moment it was made, plus the hardware address of the machine that made it — so anyone reading one can trace it back to a moment and a device. When privacy matters, choose v4 or v7 instead, which carry no such trail.
  • Do not store UUIDs as plain text when space matters. Written out, a UUID takes 36 characters; kept as raw bytes it takes only 16. Where your database provides a built-in UUID column type, prefer that over a text column.
  • Never type a UUID out by hand. Always copy and paste it instead — a single mistyped character quietly points to a different record, or to none at all.

Getting Your Own UUID in Seconds

Working out a UUID with pen and paper is not something anyone needs to do. Open our free UUID generator, click generate, and copy the result — or generate a whole list at once for test data and database seeding. If you work with encoded data too, our Base64 to image decoder handles the other common "what is this long string?" moment, and our guide on how to fix invalid JSON syntax errors helps when an API response containing UUIDs will not parse.

Frequently Asked Questions

What is a UUID explained simply?

A UUID is a 128-bit unique ID, written as 36 characters in five hyphen-separated groups (for example, f47ac10b-58cc-4372-a567-0e02b2c3d479). Any computer can create one without asking a central server, and it is practically impossible for two UUIDs to be the same. UUID stands for Universally Unique Identifier.

Can two UUIDs be the same?

Almost never. Version 4 alone offers about 2122 possible values, and you would need to mint roughly 2.7 quintillion of them before the odds of a single repeat even reach fifty-fifty. That is why software treats UUIDs as unique in day-to-day use, even though the guarantee is statistical, not absolute.

Is a UUID the same as a GUID?

Yes. Microsoft's name for this same 128-bit format is GUID, and the two words can be used interchangeably — one shared format, one shared RFC specification.

How long is a UUID?

A UUID is always 128 bits (16 bytes). As text, it is 36 characters long: 32 hexadecimal digits plus 4 hyphens, grouped 8-4-4-4-12.

Which UUID version should I use?

For most jobs, version 4 (random) is the right pick — it is the everyday default. Version 7 (time-ordered) suits a database primary key, because it sorts by creation time. Version 5 fits when the same name must always produce the same ID.

Are UUIDs safe to share publicly?

Sharing a UUID is usually fine because it is only an identifier, not a secret — but never use one as a password, login token, or private link. If a UUID guards access to something, replace it with a proper authentication system.

The Bottom Line

A UUID is a simple answer to a hard problem: how do you give everything a unique name when no single computer is in charge? It is a 128-bit number, written as 36 characters, that any device can generate on its own. Version 4 covers most everyday uses, version 7 is the modern choice for database keys, and a GUID is the same thing under Microsoft's name. Next time you see a string like f47ac10b-58cc-4372-a567-0e02b2c3d479, you will know exactly what it is — and if you need one yourself, our free UUID generator tool makes one in a single click.

Featured on LaunchNest