Home Blog What Is a UUID and Why Is It Used

What Is a UUID and Why Is It Used

23/06/2026

If you work with databases, APIs, or have just seen a long string like 550e8400-e29b-41d4-a716-446655440000 in code, you've come across a UUID. Let's explain in plain terms what it is and why it's used.

What is a UUID

A UUID (Universally Unique Identifier, also called a GUID) is a 128-bit identifier written as 32 hexadecimal characters split by hyphens into five groups: 8-4-4-4-12. For example:

550e8400-e29b-41d4-a716-446655440000

The core idea: a UUID can be generated anywhere — on different servers, devices, or even offline — while practically guaranteeing that you'll never get two identical ones. The odds of a collision are so tiny they're considered negligible.

Why it's needed

Database records are usually numbered sequentially: 1, 2, 3... But that approach has problems:

  • Distributed systems. If data is created on several servers at once, sequential numbers start to collide. Each node generates its own UUID independently, so there are no conflicts.
  • Obscurity. A URL like /user/1, /user/2 reveals how many users you have and lets someone enumerate other people's records. A UUID can't be guessed.
  • Client-side generation. An app can assign an object an ID before it's even sent to the server.

UUID versions

Two versions are used most often:

  • UUID v4 — fully random. The most popular option: it simply takes 122 random bits. This is what's generated by default for most use cases.
  • UUID v1 — based on a timestamp and the device's MAC address. It guarantees chronological order but can reveal information about the machine.

For most tasks — record identifiers, API keys, file names — v4 is the one to use.

How to generate a UUID

There's no need to write anything by hand: use the UUID generator — it creates a random UUID v4 right in your browser, and you can copy it in one click or generate several at once. Generation happens locally, and nothing is sent to a server.

A UUID is not a hash

UUIDs are sometimes confused with hashes. The difference is fundamental: a UUID is random and doesn't depend on anything, while a hash (like MD5 or SHA-256) is a "fingerprint" of specific data — the same input always produces the same hash. If you need a data fingerprint rather than a random ID, check out the hash calculator.

← All articles