devtools.cihat.dev

UUID generator: v4 and v7

This UUID generator makes fresh UUIDs with your browser’s secure random generator: random v4, or v7 that sorts by creation time. Make one or a thousand, and check any UUID you already have.

Version

Your UUIDs

How to use it

  1. Pick v4 or v7 and how many you need, from 1 to 1000. A first batch is ready when the page opens.
  2. Choose the layout (one per line, comma-separated or a JSON array) and the format: uppercase, without hyphens or in braces.
  3. Copy or download the list. Paste any UUID under “Check a UUID” to see its version, variant and, for v1, v6 and v7, when it was made.

What a UUID is

A UUID (universally unique identifier) is a 128-bit number that any computer can create on its own, without asking a central server, and still not clash with anyone else’s. The current standard is RFC 9562, published in May 2024; it replaced RFC 4122 and added versions 6, 7 and 8.

A UUID is written as 32 hex digits in five groups, 8-4-4-4-12, so the text form is 36 characters with the hyphens: 550e8400-e29b-41d4-a716-446655440000. Two positions carry fixed meaning. The first digit of the third group is the version (4 here). The first digit of the fourth group is the variant; for RFC 9562 UUIDs it is 8, 9, a or b.

v4 or v7?

Both are standard and fit any column or field that stores a UUID. The difference is what the 128 bits hold.

UUID v4UUID v7
Content122 random bits48-bit Unix time in milliseconds, then 74 random bits
Sort orderRandomBy creation time
RevealsNothingWhen it was made, to the millisecond
Database indexNew rows land anywhere in the indexNew rows land at the end, so the index stays compact
Best forPublic IDs, tokens in URLsPrimary keys, event and log IDs

How v7 keeps order

In a v7 UUID the first 12 hex digits are the time. 019535d9-3df7-79fb-b466-fa907fa17f9e, the example in the PostgreSQL manual, starts with 019535d93df7, which is 1,740,365,184,503 milliseconds after 1 January 1970: 24 February 2025, 02:46:24.503 UTC. Paste it under “Check a UUID” and the tool reads that date back.

Two IDs made in the same millisecond would sort at random by their random tail. RFC 9562, section 6.2, describes ways to keep them in order; this generator uses a counter in the bits that follow the time, so every batch it makes is already sorted. RFC 9562 also says implementations should use v7 instead of v1 and v6 where they can.

Can two UUIDs collide?

A v4 has 2122 possible values. By the birthday bound, you would need about 2.7 × 1018 (2.7 quintillion) v4 UUIDs before the chance of even one duplicate reaches 50%. In practice, collisions come from broken random generators, not from the format.

The randomness here comes from crypto.randomUUID and crypto.getRandomValues, the cryptographically secure generator browsers use for encryption keys, which is what RFC 9562 asks for. Do not build UUIDs from Math.random().

Generate UUIDs in code

When you need IDs inside an application rather than a list to paste, the platform can usually make them:

Wherev4v7
Browser, Node.jscrypto.randomUUID()A library
Python 3.14+uuid.uuid4()uuid.uuid7()
PostgreSQL 18+uuidv4()uuidv7()

Special values and formats

The Nil UUID is all zeros, 00000000-0000-0000-0000-000000000000, and the Max UUID is all f; RFC 9562 defines both as markers, and the checker names them. GUID is Microsoft’s name for the same format; Windows tools often show it uppercase and in braces, which the format options reproduce. Without hyphens a UUID is 32 characters; as raw bytes it is 16.

A UUID is an identifier, not a secret: do not use one as a password or a session token on its own. To fingerprint a file instead, use the hash generator; to read the jti or sub inside a token, use the JWT decoder. A JSON array of IDs can be checked in the JSON formatter.

Questions people ask

How do I generate a UUID?

Open the page: five v4 UUIDs are already there. Change the version or the count, then copy or download the list.

Should I use UUID v4 or v7?

Use v7 for database primary keys, because it sorts by time and keeps indexes compact. Use v4 when the ID must not reveal when it was created.

Is a GUID the same as a UUID?

Yes. GUID is Microsoft’s name for the same 128-bit format. Windows tools often show it uppercase and in braces, which the format options reproduce.

How long is a UUID?

128 bits, or 16 bytes. Written out it is 32 hex digits, or 36 characters with the four hyphens.

Are these UUIDs stored or sent anywhere?

No. They are generated in your browser and exist only on this page until you copy them.

Can I get the date back from a UUID?

From v1, v6 and v7, yes: paste it under “Check a UUID”. A v4 has no time in it.

Are UUIDs really unique?

Not guaranteed, but for v4 you would need about 2.7 quintillion of them for a 50% chance of one duplicate, as long as the random generator is sound.