Maaz Zindani

Loading the index…

↑↓ move↵ openesc close3993 pages

Free tool · Developer tools

UUID generator (v4 and v7)

Make one UUID or thousands, random (v4) or time-ordered (v7), in the format your code expects. You can also paste a UUID to see its version, variant and, for v7, the time inside it. Nothing leaves your device.

  • Free
  • No sign-up
  • Runs in your browser

By Maaz Zindani · Updated

What do you want to do?
Version
Format
Your UUIDs

5 UUIDsVersion 4, random. Made in your browser; nothing is sent.

7b0e9ba9-8a7a-42d2-9c58-269a66000751 6da2a67f-2896-4b47-b645-8e10180d209b f30578dc-2b93-484d-b81a-c58e4248187f 55cb8e3a-4862-4889-a0a1-edc215e06c29 7a1c8642-26cf-4eb3-b304-74942122d861
  • 122 random bits each
  • crypto.getRandomValues
Version
4, random
Count
5
Length each
36 characters
Time inside
None, all random

How to use the UUID Generator

  1. Under What do you want to do? keep Generate UUIDs, then pick the Version: v4 (random) or v7 (time-ordered).
  2. Type a number under How many (1 to 5,000). Use Generate again for a fresh set.
  3. Choose the Format: Uppercase, Hyphens, Wrap each UUID in braces or a urn:uuid: prefix, and List as lines, commas, quoted or a JSON array.
  4. Press Copy or Download. To inspect a UUID, choose Check a UUID and paste it.

What is a UUID, and what is the difference between v4 and v7?

A UUID (universally unique identifier, also called a GUID) is a 128-bit value written as 32 hexadecimal digits in groups of 8-4-4-4-12, such as 919108f7-52d1-4320-9bac-f847db4148a8. A program can make one without asking a central server for the next number, which is why UUIDs are used as record ids, file names and request ids. RFC 9562, published in May 2024, is the current specification and replaces RFC 4122.

The version is the first digit of the third group, here the 4. A version 4 UUID is 122 random bits plus 6 fixed bits that mark the version and the layout, so nothing in it means anything. A version 7 UUID starts with the Unix time in milliseconds in its first 48 bits (the first 12 hex digits), followed by 74 random bits. A v7 UUID made later therefore sorts after one made earlier, and anyone who reads it can tell when it was made. Every random bit here comes from the browser's secure generator, crypto.getRandomValues, never from Math.random.

How do I generate many UUIDs at once, in uppercase or without hyphens?

Pick the version, type a number from 1 to 5,000 under How many and the list appears at once. Generate again makes a new set. The format options only rewrite the UUIDs already on screen, so you can switch between 919108f7-52d1-4320-9bac-f847db4148a8 and 919108F752D143209BACF847DB4148A8 without losing the list. Wrap each UUID in adds braces, as some Windows tools write them, or a urn:uuid: prefix. List as chooses one per line, comma separated, quoted ('a', on each line, handy for SQL and code) or a JSON array. The two spellings of a UUID are the same 128-bit value, so use whichever your system expects.

A v7 list from this tool is in creation order. UUIDs made in the same millisecond carry a counter in the 12 bits after the version, so each one sorts after the one before it; this is the first of the methods RFC 9562 describes in section 6.2. If the clock ever moves backwards, the tool keeps the last time instead of going back, and a counter that runs out moves the time forward by one millisecond.

Can two UUIDs collide?

In theory yes, in practice not with a good random source. A v4 UUID has 122 random bits, about 5.3 followed by 36 zeros possible values. By the birthday formula you would have to make about 2.7 followed by 18 zeros of them, a billion a second for roughly 86 years, before the chance of a single repeat reaches 50 percent. RFC 9562 itself says that true global uniqueness cannot be guaranteed without a shared scheme and that generators should use a cryptographically secure random source, which is why this tool never falls back on a weaker one.

So treat uniqueness as extremely likely, not guaranteed. Keep a unique index on the column and let the database reject a repeat. A v7 UUID has 74 random bits per millisecond, so a clash needs two machines to create one in the same millisecond and pick the same 74 bits.

Which UUID version should I use as a database key?

RFC 9562 explains that random values such as v4 land at random places in an index, so every insert touches a different page and large tables slow down. Time-ordered values cluster together, and the RFC says implementations should prefer v7 over the older time-based v1 and v6 where possible. For a new table, v7 is usually the better primary key. Keep v4 for identifiers that must reveal nothing, such as a token in a link, because a v7 UUID shows its creation time to anyone who looks.

Where the database has a 128-bit uuid or binary type, store the value in it and not as a 36-character string; the RFC recommends binary storage where feasible.

How do I tell which version a UUID is?

Choose Check a UUID and paste it. Braces, quotes, a urn:uuid: prefix and missing hyphens are all accepted. The result gives the version (the first digit of the third group), the variant (the first digit of the fourth group is 8, 9, a or b for the RFC 9562 layout), the standard lower-case form and what you pasted. For versions 1, 6 and 7 it also reads the time inside the UUID and shows it in UTC and on your device. The RFC's own example 017F22E2-79B0-7CC3-98C4-DC0C0C07398F is version 7 made at 19:22:22 UTC on 22 February 2022. The all-zero Nil UUID and the all-ones Max UUID are recognized too, and an error message tells you if a UUID has the wrong length, a character that is not hex or misplaced hyphens.

Use it with

Questions

What is a UUID and what is v4 vs v7?

A UUID is a 128-bit identifier written as 32 hex digits. A v4 UUID is random. A v7 UUID begins with the Unix time in milliseconds, so newer ones sort after older ones.

How do I generate many UUIDs at once?

Type a number from 1 to 5,000 under How many. The whole list is made at once and can be copied or downloaded as text or a JSON array.

Can two UUIDs collide?

It is possible but extremely unlikely: about 2.7 followed by 18 zeros v4 UUIDs would be needed for a 50 percent chance of one repeat. Uniqueness is not guaranteed, so keep a unique index.

Which UUID version should I use as a database key?

v7 for most new tables, because time-ordered values cluster in the index. Use v4 where the id must reveal nothing.

Can I get uppercase or no-hyphen UUIDs?

Yes. Tick Uppercase, untick Hyphens, and choose braces or a urn:uuid: prefix under Wrap each UUID in.

Are these UUIDs generated securely?

Yes. All random bits come from crypto.getRandomValues in your browser, and nothing is sent anywhere.

How this page was made: the tool's results are computed in your browser by the code on this page, using the sources listed above; the explanations were drafted with AI help and checked against the tool's own output.