The UUID Generator creates random version 4 UUIDs (also called GUIDs), from 1 to 100 at a time, using the browser's cryptographically secure crypto.randomUUID(). Developers use them as database primary keys, idempotency keys, request IDs, and test fixtures.
Input
Count 1
Output
591adc04-e3ff-47c5-9974-28eb7e385328
Input
Count 2
Output
11cafd0c-8189-4509-b340-627cb2275930 5345b026-8ee5-45a3-8f80-99c58be6a187
A UUID is a 128-bit identifier written as 32 hexadecimal digits in five groups: 8-4-4-4-12. Version 4, defined in RFC 9562 (which replaced RFC 4122 in 2024), fills almost all of those bits with random data. Six bits are fixed: the 13th hex digit is always 4, marking the version, and the 17th is always 8, 9, a, or b, marking the RFC variant. You can see both in every example above, such as 47c5 and 9974 in the first one. That leaves 122 random bits.
With 122 random bits there are about 5.3 × 10^36 possible values. The chance of two UUIDs colliding stays negligible even at enormous scale: you would need to generate roughly 2.7 quintillion (2.7 × 10^18) of them before reaching a 50% chance of a single duplicate. That is what lets separate servers, mobile apps, and offline clients create IDs independently without a central counter.
The randomness comes from crypto.randomUUID(), which draws from the operating system's cryptographically secure random number generator, the same source used for encryption keys. That matters because UUIDs built with Math.random() can repeat or be predicted. Even so, a UUID is an identifier, not a secret: it is not designed to be unguessable in the way a session token is, so use the API key generator or random string generator for credentials.
As a primary key, a random v4 UUID spreads inserts across a B-tree index, which can slow large tables in MySQL InnoDB or SQL Server. If insert order matters, consider UUID version 7, which starts with a millisecond timestamp so new IDs sort roughly by creation time. PostgreSQL stores UUIDs in a native 16-byte uuid column; in MySQL, BINARY(16) is smaller and faster than CHAR(36). The format here is lowercase, which RFC 9562 recommends for output; UUIDs are compared case-insensitively, so uppercase versions refer to the same value.
More Developer Tools