Generate UUID v4 and v7

Generate random version 4 UUIDs or time-ordered version 7 UUIDs (RFC 9562) — one or a hundred at a time — using the browser’s cryptographic random number generator. Paste an existing UUID to see its version and variant, and for a v7 the millisecond it was created.

v4 or v7

A v4 UUID is 122 random bits: unique in practice and completely unordered. A v7 starts with a 48-bit Unix timestamp in milliseconds, so values sort by creation time — which keeps database indexes compact and makes "newest first" a simple sort. Use v7 for primary keys and v4 where the value must not reveal when it was made.

UUIDs in API tests

Idempotency keys, correlation ids and client-generated resource ids are all UUIDs in most APIs. A test should generate a fresh one per run — a hard-coded key replays the first run's response forever and hides the bug the key was meant to catch.

What the version digit means

The thirteenth hex digit is the version and the seventeenth encodes the variant. A value with 4 there is random; 7 is time-ordered; 1 embeds a timestamp and a node id. A string in the right shape with a version of 0 or above 8 is a placeholder, not a generated UUID.

Other tools

All tools · Getting started guide · All 55 mock REST APIs

Last updated