ToolNest

UUID Generator

Free UUID v4 generator. Generate one or hundreds of cryptographically random UUIDs and copy them with one click.

UUIDs are version 4 (random), generated with crypto.randomUUID() on your device.

A UUID is a 128-bit identifier that can be generated independently on any machine with a negligible chance of ever colliding with another. That property makes it the standard way to create database keys, request identifiers and file names without a central authority handing out numbers.

This generator produces version 4 UUIDs — the random variant — using your browser’s cryptographically secure random source. Generate one or hundreds at a time.

How to use the UUID Generator

  1. Choose how many you need

    One, or a batch of hundreds for seeding test data.

  2. Generate

    Each UUID is produced from cryptographically secure randomness, not a predictable pseudo-random sequence.

  3. Copy the results

    One click copies the whole batch, ready to paste into a fixture file or a query.

What a v4 UUID looks like

The format is xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx — 32 hexadecimal digits in five hyphen-separated groups. The 4 in the third group marks the version, and the first digit of the fourth group encodes the variant.

That leaves 122 random bits. The collision probability is so small that you would need to generate about 2.7 × 10^18 UUIDs before reaching a one-in-a-billion chance of any two matching — roughly a billion UUIDs a second for a century.

The UUID versions

VersionBased onSortable?Notes
v1Timestamp + MAC addressRoughlyLeaks the generating machine’s MAC address
v3MD5 of a nameNoDeterministic — same input gives same UUID
v4RandomNoThe default choice for almost everything
v5SHA-1 of a nameNoDeterministic; preferred over v3
v7Timestamp + randomYesNewer; designed for database primary keys

Use v4 unless you have a specific reason not to. Use v5 when you need the same input to always produce the same identifier, and v7 when insert-order locality in a database index matters.

Where UUIDs are used

  • Database primary keys — generated by the application before insert, so no round trip to the database is needed to learn the ID.
  • Distributed systems — several services can create records independently with no coordination and no risk of collision.
  • Request and trace IDs — a UUID per request ties log lines together across services.
  • Idempotency keys — payment APIs use them so a retried request cannot charge a customer twice.
  • File and object names — avoids collisions and prevents users guessing other users’ files.
  • Session and device identifiers.

UUIDs as database primary keys

The trade-off is real. UUIDs remove the need for a central sequence and stop users enumerating your records by incrementing an ID — but they cost more than an integer key.

A UUID takes 16 bytes against 4 or 8 for an integer, and because v4 values are random, consecutive inserts land in random positions in a B-tree index. That causes page splits and fragmentation, which measurably slows write-heavy workloads on large tables.

The modern answer is UUID v7, which puts a timestamp in the high bits so values sort roughly by creation time. Inserts stay sequential in the index while keeping the uniqueness and unguessability of a UUID. If your database supports it, prefer v7 for primary keys and keep v4 for everything else.

A caution

A UUID is unique, not secret. Version 4 values from a cryptographic source are unguessable in practice, but UUIDs frequently appear in URLs, logs and analytics, so they should not be treated as access tokens.

Anything that must not be forged needs a signed token or a proper capability check, not a UUID in a query string.

Frequently asked questions

What is a UUID?

A 128-bit universally unique identifier, written as 32 hexadecimal digits in five hyphen-separated groups. It can be generated anywhere without coordination and will not realistically collide with any other.

Can two UUIDs ever be the same?

In theory yes, in practice no. With 122 random bits you would need around 2.7 × 10^18 UUIDs before reaching a one-in-a-billion chance of a collision.

What is the difference between UUID and GUID?

None technically — GUID is Microsoft’s name for the same 128-bit standard. The terms are interchangeable.

Which UUID version should I use?

Version 4 for general use. Version 5 when the same input must always yield the same identifier, and version 7 for database primary keys where index locality matters.

Are UUIDs good primary keys?

They have real advantages — no central sequence, and users cannot enumerate records. But v4 randomness fragments B-tree indexes on write-heavy tables. UUID v7 solves this by making values time-ordered.

Are these UUIDs random and secure?

Yes. They use the browser’s cryptographically secure random source rather than a seeded pseudo-random function, and are generated entirely on your device.

Can I use a UUID as a secret token?

It should not be relied on as one. UUIDs appear in URLs, logs and analytics tools. Use a signed token or a proper authorisation check for anything that must not be forged.

How many can I generate at once?

Hundreds in a single batch, which is enough for seeding test fixtures. Everything is generated locally, so nothing is sent anywhere.

100% private. Files are processed on your device and never uploaded.

Instant results. No upload queue. Processing time depends on your device.

Free forever. No signup, no watermark, no paid tier.

Works everywhere. Use a modern browser on your phone or computer.

Related tools

UUID Generator is one of all the free tools on ToolNest. No account or subscription needed — anywhere in the world.