200 tools

Web Developer Tools · · 4 min read

How to Generate a UUID (v4 or v7) Online

Use the UUID Generator to create random v4 or time-ordered v7 UUIDs in bulk, with options for case, hyphens and brace-wrapped formatting.

To generate a UUID, open the UUID Generator, choose v4 (random) or v7 (time-ordered), set How many you need, and copy the list — it's generated instantly in your browser with no sign-up or server round trip.

What a UUID is and why it matters

A UUID (universally unique identifier) is a 128-bit value, almost always written as 32 hex characters split into five groups — 8-4-4-4-12 — like 698522a1-a495-4493-bc7d-f5064c0bcae0. It's used wherever you need an identifier for a database row, API object, file, or session that won't collide with one generated somewhere else, without a central authority handing out sequential numbers. Toolbench's UUID Generator produces two of the most common versions: v4, which is fully random, and v7, which embeds a timestamp so the IDs sort in the order they were created.

How to generate a UUID with Toolbench

  1. Open the UUID Generator.
  2. Set How many — any whole number from 1 to 1,000.
  3. Pick Version: v4 (random) for a standard random UUID, or v7 (time-ordered) if you want IDs that sort chronologically (useful as database primary keys).
  4. Toggle Uppercase if you need capital hex letters instead of lowercase.
  5. Toggle Hyphens off if you want a plain 32-character string with no dashes.
  6. Toggle Wrap in {} on if your target system expects the Windows-style GUID format with curly braces.
  7. Click ↻ Regenerate to draw a fresh batch, or copy the current list as-is.

Example: the defaults (10 UUIDs, v4, hyphens, lowercase)

With the defaults untouched, the tool returns 10 lowercase, hyphenated v4 UUIDs, one per line. A real batch looks like this:

698522a1-a495-4493-bc7d-f5064c0bcae0
671ef34e-9a2d-469b-b976-8b3d9e85e9a2
d09fcdcc-d0e6-4c8f-ac26-943b018f09f7
baad4828-ed11-43bc-8423-5541e205c781
6a82a034-11a5-4c39-8c6b-9d3cd6bc7420

Notice the 4 right after the second hyphen in every one of them — that's the version digit, fixed for every v4 UUID. The rest is drawn from your browser's cryptographically secure random number generator (crypto.getRandomValues).

Example: switching to v7 (time-ordered)

Switch Version to v7 (time-ordered) and generate a batch in the same second:

01a1bb78-441e-7ef6-8e10-151165b1639e
01a1bb78-441e-785f-b313-c962ef7024c1
01a1bb78-441e-7c7a-bf28-dc10242a0dfb

The first 12 hex characters (01a1bb78-441e) encode the current timestamp in milliseconds, so they're identical across UUIDs generated at the same moment and strictly increasing across batches generated later. The version digit is 7 instead of 4, and everything after it is still random. This is why v7 is the better choice for a database primary key: rows insert in roughly the same order their IDs sort in, which keeps B-tree indexes from fragmenting the way random v4 keys do.

v4 vs v7: which to use

v4 (random) v7 (time-ordered)
Ordering No pattern — fully random Sorts by creation time
Predictability None — can't guess the next one First 48 bits reveal creation time
Best for API tokens, session IDs, anything that shouldn't leak timing Database primary keys, event logs, anything you'll sort or paginate by creation order
Randomness 122 random bits ~74 random bits (48 bits are the timestamp)

Both formats are 128 bits total and equally safe from collisions in practice — the difference is only whether creation time is baked into the value.

Tips and common mistakes

  • 1,000 is the limit per batch. The How many field is capped at 1,000; enter a larger number and it's clamped down automatically.
  • Hyphens off ≠ a different UUID. Toggling Hyphens just removes the dashes from the same 32 hex characters — it doesn't change the underlying value.
  • {} wrapping is for GUID-style systems. Some Windows APIs and config files expect UUIDs wrapped in curly braces ({698522a1-...}); that's what the Wrap in {} toggle is for.
  • Don't use v7 if the creation time must stay private. Because the timestamp is embedded in the first part of a v7 UUID, anyone who sees the ID can tell roughly when it was created — stick to v4 if that's a problem.
  • Click Regenerate for a new batch. The list doesn't change on its own; use the ↻ Regenerate button to draw fresh UUIDs with the same settings.

Frequently asked questions

What's the difference between UUID v4 and v7?

v4 is entirely random — every bit except the fixed version and variant markers comes from a secure random number generator. v7 embeds the current Unix timestamp in milliseconds in its first 48 bits, so v7 UUIDs generated later always sort after ones generated earlier, while v4 UUIDs have no inherent order.

Can two generated UUIDs ever collide?

In practice, no. A v4 UUID has 122 random bits, giving roughly 2.7 × 10³⁶ possible values — you'd need to generate billions of UUIDs per second for billions of years before a collision became likely by chance.

Is it safe to use a UUID as a public identifier, like in a URL?

Yes for v4 — it's unguessable and doesn't reveal anything about when it was created. Be more careful with v7 in public-facing contexts, since its first 12 characters expose the creation timestamp.

Why does every v4 UUID have a "4" in the same position?

That digit is the version field, defined by the UUID spec (RFC 4122) to mark which generation algorithm produced it. Toolbench's generator sets it automatically — it's not something you configure.

Are the UUIDs sent to a server to generate?

No. They're generated entirely in your browser using crypto.getRandomValues. If you're signed in, the UUIDs you generate sync privately to your account; if you're signed out, nothing is saved anywhere.

More guides

All guides →