Developer & Data100% Free for AllClient-Side PrivateAuto-saved (3 days)

UUID / GUID Generator

Generate random v4 UUIDs for database primary keys, API tokens, and unique identifiers. Bulk generation up to 100 UUIDs at once.

A UUID is a 128-bit identifier you can generate independently on any machine with a vanishing probability of collision — no coordination, no central sequence, no database round trip. Version 4 UUIDs, the kind this tool produces, are 122 bits of randomness. That is enough that generating a billion per second for a century still leaves the odds of a duplicate negligible. Generation uses the browser's cryptographic random source and happens entirely on your device.

How to generate a UUID

  1. Choose how many identifiers you need — one for a quick test, or a batch for seeding fixtures.
  2. Click Generate. Each UUID appears in the canonical 8-4-4-4-12 hyphenated form.
  3. Copy an individual value, or copy the whole batch at once for pasting into a seed script.
  4. Regenerate freely; every click produces entirely fresh values.

The UUID / GUID Generator runs entirely in your browser — nothing you enter is uploaded, stored, or logged.

When to use this tool

Assigning primary keys before insert

Generating the id client-side lets you build an entire object graph with valid references before anything reaches the database, which simplifies offline-first and optimistic-update patterns considerably.

Correlating requests across services

A UUID attached to an incoming request and propagated through every downstream call turns a distributed trace into a single greppable string.

Naming uploaded files safely

Storing an upload under a UUID rather than its original filename removes an entire class of path traversal and collision problems in one step.

Things worth knowing

  • Version 4 UUIDs are random, so they scatter across a B-tree index. On very large tables this hurts insert performance — UUIDv7, which is time-ordered, is the modern answer.
  • UUIDs are case-insensitive by specification but conventionally written in lowercase. Normalise before comparing as strings.
  • Stored as text a UUID is 36 characters; stored as a native binary or uuid column it is 16 bytes. On large tables that difference is worth having.
  • Do not treat a UUID as a secret. It is unguessable, but it is not an access control mechanism.

Frequently Asked Questions

What is a UUID v4?

A Version 4 UUID is a 128-bit number generated using cryptographically random numbers.

What is the chance two UUIDs collide?

Negligible in any realistic system. You would need to generate roughly 2.7 × 10^18 version 4 UUIDs before reaching a 50% chance of a single collision. For comparison, that is more identifiers than there are grains of sand on Earth.

What is the difference between UUID v1, v4, and v7?

Version 1 derives from a timestamp and the machine's MAC address, which makes it sortable but leaks hardware information. Version 4 is purely random and leaks nothing, which is why it is the common default. Version 7 is a newer standard combining a timestamp prefix with randomness, giving you both database-friendly ordering and privacy. This tool generates version 4.

Can I use UUIDs as database primary keys?

Yes, and it is common. The trade-off is index locality: random v4 values insert all over the index rather than at the end, which increases page splits on very high-volume tables. Store them in a native uuid or binary(16) column rather than as text, and consider UUIDv7 if insert throughput is a concern.

Are these UUIDs cryptographically secure?

They are generated from crypto.getRandomValues(), the browser's cryptographically secure random source, so the values are unpredictable. That still does not make a UUID a suitable secret or session token on its own, because UUIDs routinely end up in logs, URLs, and analytics.

Why do all version 4 UUIDs have a 4 in the same position?

The 13th hexadecimal digit is fixed to '4' to identify the version, and the 17th is constrained to 8, 9, a, or b to encode the variant. Those six bits are why a v4 UUID carries 122 bits of randomness rather than the full 128.