Skip to content

UUID Generator

Generate random v4 or time-sortable v7 UUIDs, one or a thousand at a time, in the format your code expects. Paste any UUID below to see its version, variant and timestamp.

RunsIn browser
Sign-upNone
UploadsZero
Your UUID
10 UUIDs
Validate & inspect a UUID

v4 or v7?

UUID v4 is 122 random bits with a fixed version and variant. The chance of two ever colliding is negligible, and it reveals nothing about when or where it was made. Use it for public identifiers and tokens that should not be guessable or orderable.

UUID v7, defined in RFC 9562 (2024), starts with a 48-bit Unix timestamp in milliseconds, followed by random bits. New IDs sort after older ones, which keeps database B-tree indexes compact and inserts fast. It is the better default for primary keys. The trade-off is that anyone can read the creation time from the ID. This generator also uses the 12 bits after the version as a counter, so IDs made in the same millisecond still come out in order.

The nil (all zeros) and max (all ones) UUIDs are special values, often used as “none” or “end of range” sentinels.

Questions

Are these UUIDs really unique?

For practical purposes, yes. A v4 UUID has 122 random bits from your browser’s cryptographic generator. You would need to create about 2.7 quintillion of them before a single collision became 50% likely. v7 UUIDs add a millisecond timestamp in front of 74 bits of randomness and counter.

What is the difference between a UUID and a GUID?

They are the same 128-bit format. GUID is Microsoft’s name for it, and Windows tools often write GUIDs in uppercase with braces, like {3F2504E0-4F89-41D3-9A0C-0305E82C3301}. Use the Uppercase and Braces options to match that style.

How do I get the timestamp out of a UUID v7?

The first 12 hex digits (48 bits) are the Unix time in milliseconds. Paste the UUID into the inspector above to see it as a date, or in code parse the first 12 hex characters as an integer, e.g. parseInt(uuid.replace(/-/g,'').slice(0,12), 16).

Should I store UUIDs as strings in my database?

Use a native UUID type if your database has one (PostgreSQL uuid, SQL Server uniqueidentifier), or BINARY(16) in MySQL. That takes 16 bytes instead of 36 and compares faster. v7 keys work especially well because new rows are appended at the end of the index.

Is anything sent to a server?

No. UUIDs are generated with crypto.randomUUID and crypto.getRandomValues in your browser. Only your format preferences are remembered on this device.