FA Dev Tools

Generate UUID

Create one or more random UUID v4 values using crypto.randomUUID().

Instructions

Generates random UUID v4 values, one per line.

  1. Set how many you want.
  2. A batch appears straight away; Generate gives you a fresh one with the same count.
  3. Copy the whole block with the button beside it.

Tips

  • Values come from crypto.randomUUID(), the browser's cryptographic random source — not Math.random().
  • Version 4 UUIDs are random, not ordered. If you need IDs that sort by creation time, a v4 UUID is the wrong tool.
  • Generation happens in your browser; the count you chose is remembered, the values are not.
  • Hit Example and click Generate to get a batch of five.

About UUIDs

What a UUID is for

A UUID (universally unique identifier) is a 128-bit value written as 32 hexadecimal digits in five groups, like 3f2b8c1e-9d4a-4b6f-a1c2-7e5d9f0b3a68. Microsoft calls the same thing a GUID. Its point is that any machine can make one on its own, with no central counter or database round trip, and still be confident nobody else will ever make the same one.

That makes UUIDs useful as database primary keys, request and trace IDs in logs, file names for uploads, idempotency keys for payment APIs, and IDs created offline on a phone that must not clash when they sync later.

How a version 4 UUID is built

The current standard is RFC 9562 (2024), which replaced RFC 4122. A version 4 UUID is almost entirely random: 122 of its 128 bits come from a random number generator. The other six bits are fixed. The first digit of the third group is always 4 (the version), and the first digit of the fourth group is always 8, 9, a or b (the variant). That is how you can tell a v4 UUID at a glance.

With 122 random bits there are about 5.3 × 1036 possible values. You would need to generate roughly 2.7 × 1018 of them before the chance of a single duplicate reached 50%. In practice, a collision only happens when the random source is broken, which is why the source matters more than the format.

Other UUID versions

Version 1 mixes a timestamp with the machine's network card (MAC) address, which can leak where and when an ID was made. Versions 3 and 5 hash a namespace and a name (MD5 and SHA-1), so the same input always gives the same UUID. Version 7, added in RFC 9562, starts with a 48-bit Unix timestamp in milliseconds followed by random bits.

The difference that matters most is ordering. Version 4 values are scattered at random, so inserting them into a B-tree index (the primary key index in MySQL, PostgreSQL and most other databases) writes all over the index. Version 7 values sort by creation time, which keeps inserts at the end of the index and makes them faster on large tables. If you need IDs that sort by time, pick v7.

What this tool does

This tool makes version 4 UUIDs only, using the browser's built-in crypto.randomUUID(). That function draws from the operating system's cryptographically secure random source, not from Math.random(). You can generate 1 to 100 at a time, one per line, in lowercase, and copy the whole batch with one click. Generation happens in your browser. The count you chose is remembered for next time; the UUIDs themselves are not stored or sent anywhere.

Frequently asked questions

Can two UUIDs ever be the same?
In theory yes, in practice no. A v4 UUID has 122 random bits, so you would need billions of billions of them before a duplicate became likely. Real collisions come from bugs, such as a badly seeded random generator or copying an ID instead of generating a new one.
What is the difference between a UUID and a GUID?
Nothing meaningful. GUID is Microsoft's name for the same 128-bit format. Some Microsoft tools show GUIDs in uppercase or wrapped in braces, but the value is the same.
Should I use UUID v4 or v7 for a database primary key?
Use v7 when the table will grow large, because v7 values sort by time and keep index inserts cheap. Use v4 when you don't want the ID to reveal when a record was created.