UUID Generator: v4 and v7, Single or Bulk

Generate random UUID v4 or time-ordered UUID v7 values, one or up to 1,000 at a time, and inspect any UUID. Uses your browser's secure random generator.

Runs in your browser. Nothing is uploaded.

Example

Input:

Version 7, count 2

Result:

01a1ab26-a900-7c1e-9a3d-5f0e8b1c2d3e
01a1ab26-a900-7c1f-8e61-0c4a9d7b6e15  (both created 2026-11-05T10:00:00Z)

v4 or v7?

A UUID v4 is 122 random bits: unpredictable and fine as a public identifier, but random values scatter across a database index, which slows inserts on large B-tree indexes. UUID v7, standardised in RFC 9562 (2024), puts a 48-bit Unix timestamp in milliseconds first and fills the rest with random bits. New values sort roughly by creation time, so they insert at the end of an index like an auto-increment key while staying globally unique without coordination.

Use v7 for primary keys in PostgreSQL or MySQL and for event or log ids you want to sort by time. Use v4 when the id must not reveal when it was created, for example in password-reset links, because a v7 id exposes its creation time to anyone who reads it.

How the values are generated

v4 values come from crypto.randomUUID(), and v7 values are built from Date.now() plus crypto.getRandomValues(), both backed by the browser's cryptographically secure generator. Nothing is generated on a server and nothing is logged. Values created in the same millisecond keep their order by incrementing a counter in the random part, as RFC 9562 allows.

Never build ids with Math.random(): it is not cryptographically secure, and values can repeat or be predicted. In databases, store UUIDs in a native uuid column (PostgreSQL) or as 16 bytes (BINARY(16) in MySQL) rather than a 36-character string; it halves the index size and keeps comparisons fast.

UUIDs versus MongoDB ObjectIds

MongoDB's ObjectId is a 12-byte id that also starts with a timestamp, in seconds, which is why ObjectIds sort by creation time too. Inside MongoDB, ObjectId is the natural choice and is smaller than a UUID. Use UUIDs when ids must be created by clients or other systems before they reach the database, or when they must be unique across several databases. The inspector here reads the version and, for v7, the embedded creation time of any UUID you paste.

Frequently asked questions

Are these UUIDs truly unique?

For practical purposes, yes. v4 has 122 random bits; the chance of a collision is negligible even across billions of values.

Is UUID v7 safe to expose publicly?

It is unguessable enough for ids, but it reveals its creation time. Use v4 when that time is sensitive.

How do I generate a UUID in Node.js?

crypto.randomUUID() in Node 14.17+ gives a v4. For v7, use the uuid package (v7()) or a small helper like the one this tool uses.

Related tools