Generate up to 100 UUIDs at a time. Version 4 is random; version 7 starts with its creation time, so a v7 list sorts in the order it was made. Uppercase and No hyphens reformat the current list, and changing the version makes a new one. Copy takes the whole list, one UUID per line.
Example
Input: version v7, How many = 3, Uppercase off, No hyphens off.
018f3a7c-5e21-75c2-9b4d-2e6f81c05a17
018f3a7c-5e21-75c3-8c91-47d0b3e6f2a5
018f3a7c-5e21-75c4-a0f6-1b82c9d47e30
The first 12 hex digits (018f3a7c5e21) are the timestamp, 7 is the version, 5c2–5c4 is a counter that increases within the same millisecond, and the next digit (9, 8, a) is the variant.
Version v4 with Uppercase and No hyphens on:
3F9C2A7B41D84E0A9B6C5D1E2F708A34
Generate UUIDs in code
crypto.randomUUID() (v4) is built into browsers, Node.js, Deno and Bun. Native v7: Node.js 26.1+ and Bun 1.1.34+; elsewhere, use the uuid npm package, version 10+.
import { randomUUIDv7 } from "node:crypto"; // Node.js 26.1+
import { v7 } from "uuid"; // npm package
crypto.randomUUID(); // v4
randomUUIDv7(); // v7, Node.js
Bun.randomUUIDv7(); // v7, Bun
v7(); // v7, uuid package
uuid7() is in the standard library from Python 3.14; earlier versions need a third-party package.
import uuid
uuid.uuid4() # v4
uuid.uuid7() # v7, Python 3.14+
UUID.randomUUID() (v4) works in every Java version. JDK 26 adds UUID.ofEpochMillis() for v7; the bits after the timestamp are random, so UUIDs from the same millisecond are not in order. Older JDKs need a library such as java-uuid-generator 4.1+.
import java.util.UUID;
import com.fasterxml.uuid.Generators; // library, older JDKs
UUID v4 = UUID.randomUUID();
UUID v7 = UUID.ofEpochMillis(System.currentTimeMillis()); // JDK 26+
UUID v7Lib = Generators.timeBasedEpochGenerator().generate();
Uuid.random() (v4) is stable from Kotlin 2.4. Uuid.generateV7() exists from Kotlin 2.3 but is still experimental, so it needs an opt-in.
import kotlin.uuid.ExperimentalUuidApi
import kotlin.uuid.Uuid
@OptIn(ExperimentalUuidApi::class)
fun main() {
val v4 = Uuid.random()
val v7 = Uuid.generateV7() // Kotlin 2.3+
}
gen_random_uuid() is built in from version 13 and uuidv7() from 18; on older servers, generate v7 in the application.
SELECT gen_random_uuid(); -- v4, PostgreSQL 13+
SELECT uuidv7(); -- v7, PostgreSQL 18+
CREATE TABLE orders (id uuid PRIMARY KEY DEFAULT uuidv7());
The standard library has a uuid package from Go 1.27. Earlier versions need github.com/google/uuid.
import "uuid" // Go 1.27+
uuid.NewV4().String() // v4
uuid.NewV7().String() // v7
Limitations
- Only versions 4 and 7 (no v1, v3 or v5), and at most 100 UUIDs per click.
- Pasted UUIDs are not checked or decoded, and there is no file download; use Copy.
- A v7 UUID reveals when it was created, to the millisecond, to anyone who sees it.
- v7 UUIDs made on this page are always in order; ones from another tab, a reload or another device may interleave with them.
FAQ
What is a UUID?
A universally unique identifier is a 128-bit value, written as 32 hex digits in groups of 8-4-4-4-12. Separate systems can create them without coordinating. The format is defined in RFC 9562, which replaced RFC 4122.
What is the difference between v4 and v7?
v4 is random apart from the version and variant bits, so it has no order. v7 starts with a millisecond timestamp, then a counter and random bits, so later values sort later. Use v4 for opaque IDs and v7 when creation order matters.
Can two UUIDs collide?
In theory yes, in practice almost never: a v4 has 122 random bits. v7 has fewer random bits but adds a counter, so values from one session do not repeat. Real collisions come from a faulty random source or copied values.
Is it safe to use a UUID as a database primary key?
Yes, with a caveat about indexes. Random v4 keys land anywhere in a B-tree index, causing page splits and poor cache locality on large tables. v7 keys grow with time, so inserts go near the end of the index, like an auto-increment column. The trade-off is that v7 exposes the creation time; where that matters, such as public URLs, use v4 or a separate public ID.
Do Java and Kotlin have UUID v7 built in?
In recent versions, yes: Java 26 has UUID.ofEpochMillis(), and Kotlin 2.3 has Uuid.generateV7(), still experimental and behind an opt-in. Older versions need a library; see the code examples above.