Skip to content
Developer

UUID Generator

Generate one identifier or a thousand. Version 4 is fully random; version 7 puts a timestamp at the front so a sorted list is also chronological.

Options

10 identifiers

Inspect a UUID

About the UUID Generator

A UUID is a 128-bit identifier you can generate without asking anything else for permission — no database sequence, no coordination between servers, no central authority. Version 4 gets there by being almost entirely random: 122 random bits, which is enough that the chance of ever producing the same one twice is not worth thinking about.

Version 7 is newer and, for database keys, usually the better choice. It replaces the leading 48 bits with a millisecond timestamp, which makes the identifiers sort chronologically as plain strings. That sounds cosmetic and is not: random v4 keys scatter inserts across the whole of a B-tree index, while v7 keys append to the end of it. On a large table that difference shows up as measurably worse write performance and a fragmented index.

The trade-off is that a v7 identifier reveals when it was created, to the millisecond. If the identifier will be public and the creation time is sensitive — anything that lets someone count your signups or order volume — v4 is the safer choice.

Everything here comes from the browser's cryptographic random source rather than Math.random. That matters more than it sounds: people do use these as unguessable tokens whether or not they should, and a value drawn from a predictable generator can be predicted.

The inspector reads back any UUID you paste, reporting its version, its variant, and for a v7, the timestamp embedded in it. Everything runs in your browser.

Frequently asked questions

Should I use v4 or v7?

v7 for database primary keys, because they sort chronologically and append to the end of an index rather than scattering writes across it. v4 when the identifier will be public and its creation time should not be, since v7 embeds a timestamp.

Can two UUIDs ever collide?

In theory yes, in practice no. A v4 has 122 random bits; you would need to generate billions per second for a century before a collision became likely.

Are these safe to use as secret tokens?

They come from the browser cryptographic random source, so they are not predictable. Even so, a purpose-built token of sufficient length is a better fit for anything security-critical.