Last reviewed: 2026 · Updated for 2026

UUID Generator Guide: Unique IDs, v4 vs v7 & Database Keys (2026)

A UUID (Universally Unique Identifier, also called a GUID) is a 128-bit value written as 36 characters like 550e8400-e29b-41d4-a716-446655440000. Its whole purpose is to let independent systems mint IDs that never clash without ever asking a central authority. This guide explains the versions, the trade-offs against auto-increment keys, and how to create them with a free online UUID generator.

What makes a UUID unique

The most common form, version 4, fills almost all of its bits with random data — 122 bits of randomness. The number of possible values is so vast that if you generated a billion UUIDs per second for a century, the chance of a single collision would still be negligible. That is why services can hand out UUIDs from phones, servers and browsers simultaneously and trust that they will never overlap.

The UUID versions you will meet

  • v1 — based on timestamp plus the machine's network address. Sortable but can leak the host identity and creation time.
  • v4 — fully random. The default choice: unpredictable and easy to generate anywhere.
  • v5 — deterministic, derived by hashing a namespace and a name. The same input always produces the same UUID, useful for stable identifiers.
  • v7 — time-ordered. Combines a timestamp prefix with randomness so IDs sort by creation time, which keeps database indexes tidy.

How to generate a UUID, step by step

  1. Open the UUID Generator.
  2. Pick a version — v4 for general use, v7 when you want time-ordered IDs.
  3. Generate one, or a batch if you are seeding test data.
  4. Click Copy and paste straight into your migration, seed script or API call.

UUID vs auto-increment as a primary key

Auto-increment integers are compact, human-friendly and sort naturally, but they only work cleanly inside a single database. The moment you shard, replicate or merge data from multiple sources, coordinating a single counter becomes painful. UUIDs sidestep that entirely: any node can create a valid ID offline. They also avoid exposing how many records you have — an /users/42 URL invites guessing, while a UUID does not.

The cost is size and, for random v4, index fragmentation, because new rows land in random positions. UUID v7 solves that by making IDs increase over time, giving you global uniqueness with index-friendly ordering. If you are designing URLs alongside IDs, our Slug Generatorpairs nicely for the human-readable part.

Everyday uses for UUIDs

Beyond primary keys, UUIDs are ideal for idempotency keys that prevent a retried API request from creating a duplicate charge, for correlation IDs that trace one request across many microservices, for file and upload names that must never collide, and for anonymous device or session tokens. When you need a value that is unique, opaque and generated anywhere, a UUID is usually the right tool. For fixed-format encoded values, combine it with our Hash Generator or Base64 Encoder.

Common mistakes to avoid

  • Using v1 in public IDs when you do not want to reveal timestamps or host details.
  • Storing UUIDs as plain text when your database has a native UUID type that halves the storage.
  • Assuming a UUID is secret — it is unguessable, but it is still visible to anyone who receives it.
  • Choosing random v4 for high-insert tables where v7 would keep the index healthier.

Frequently asked questions

Is the generator free? Yes — no account needed, and IDs are produced in your browser.

Is a GUID the same as a UUID? Yes. GUID is Microsoft's name for the same 128-bit identifier.

Can I generate many at once? Yes — batch generation is handy for seeding databases or writing tests.

Related tools & guides

UUID Generator →Hash Generator →Slug Generator →Base64 Encoder →Hash Generator Guide →

Related guides

Hash Generator Guide →Slug Generator Guide →JWT Decoder Guide →