ToolSec

UUID Generator (v4 & v7)

Generate random v4 UUIDs or time-ordered v7 UUIDs in bulk, ready to copy.

Updated: June 26, 2026

What is a UUID?

A UUID (Universally Unique Identifier), also called a GUID, is a 128-bit value written as 32 hexadecimal digits in the pattern xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. The point of a UUID is that you can generate one anywhere — on any machine, with no central coordination — and be confident it won't collide with any other. That makes UUIDs ideal for database primary keys, request IDs, idempotency keys and distributed systems.

v4 vs v7 — which should you use?

  • v4 (random) — 122 bits of randomness. The universal default: unpredictable and simple. The downside is that random keys are scattered, so inserting them as a database primary key can fragment the index.
  • v7 (time-ordered) — embeds a millisecond timestamp in the high bits, so v7 UUIDs sort roughly in creation order. This keeps database indexes compact and improves insert performance, while still being globally unique. It's the modern choice for new primary keys (standardised in RFC 9562).

Rule of thumb: use v7 for database keys where insert ordering matters, and v4 when you want a pure random identifier with no embedded timestamp.

Are these UUIDs secure / unique?

They are generated with your browser's cryptographic random source, so the random portions are unpredictable and the chance of a collision is astronomically small — you would need to generate billions of UUIDs before a duplicate became remotely likely. Note, however, that a v4 UUID is not a secret: it's unique, not unguessable in the security sense for short ranges. For tokens that must resist guessing, use a dedicated API key with explicit entropy instead.

Common uses

  • Primary keys that can be generated client-side before an insert.
  • Correlation/request IDs for tracing a call across microservices.
  • Idempotency keys so retried API requests aren't processed twice.
  • Stable identifiers for files, events or messages in a queue.

Bulk generation

Need a batch for seeding a database or a test fixture? Set the count and generate up to 1,000 at once, then copy them all. Every value is produced locally in your browser — nothing is sent to a server.

Frequently asked questions

What's the difference between a UUID and a GUID?

They are the same thing. GUID (Globally Unique Identifier) is Microsoft's name for a UUID. Both are 128-bit identifiers written in the same format.

Should I use UUID v4 or v7 for a database primary key?

Prefer v7 for new primary keys. Its time-ordered prefix keeps indexes compact and improves insert performance, while remaining globally unique. Use v4 when you specifically want a non-ordered random ID.

Can two UUIDs ever collide?

In practice, no. A v4 UUID has 122 random bits, so you would need to generate on the order of a billion billion before a collision becomes likely. They are safe to treat as unique.

Is a UUID a secure secret?

Not necessarily. UUIDs are designed to be unique, not unguessable. Don't use them as passwords or access tokens — use a dedicated high-entropy API key for that.

Database & distributed-systems tooling

If you're generating identifiers at scale, these platforms pair well with UUIDs:

  • Managed database / ORM Native UUID column types and v7 support that keep large indexes performant under heavy inserts.
  • Observability / tracing platform Use UUID correlation IDs to trace a single request across distributed services end to end.

Related tools