Skip to content
ToolsNow
Guides All tools
Developer

UUID generator — version 4 and version 7

Generate UUIDs in bulk — random version 4, or time-ordered version 7 that sorts chronologically. Randomness comes from your browser’s cryptographic generator.

Runs entirely in your browser — nothing is uploaded.

The usual choice. 122 bits of randomness, no ordering.

1 to 500

Generated UUIDs (0)
0 chars0 words0 lines

How to use

  1. Pick a version. v4 for general use, v7 when the IDs will be database keys.
  2. Set how many. Up to 500 at a time.
  3. Choose a format. Uppercase, no hyphens, or wrapped in braces for Microsoft-style GUIDs.

Questions

Should I use v4 or v7?

v7 if the UUID will be a primary key. Because it starts with a timestamp, new rows insert at the end of the index instead of scattering randomly through it, which avoids the write amplification and page splits that v4 causes in B-tree indexes. v4 for anything where ordering does not matter or where leaking creation time would be a problem.

Can two UUIDs collide?

In practice, no. A v4 UUID has 122 random bits. You would need to generate about 2.7 × 10¹⁸ of them before a 50% chance of any collision. Storage limits will stop you long before chance does.

Are these safe to use as secrets?

The randomness comes from crypto.getRandomValues, which is cryptographically secure, so a v4 UUID is unguessable. But UUIDs are usually treated as public identifiers and end up in logs and URLs — use a purpose-built token for secrets.

What are the nil and max UUIDs?

All-zeroes and all-ones. They are reserved sentinel values, typically used as a "no value" placeholder or an upper bound in a range query.

Related tools