UUID Generator
Generate random version-4 UUIDs.
Was this tool helpful?
Thanks for the feedback!
Click Generate UUIDs and this UUID generator gives you five fresh version-4 UUIDs, one per line, ready to copy. Each comes from your browser's crypto.randomUUID(), which fills 122 of the 128 bits from a cryptographically secure random source, and nothing is fetched from a server.
Anatomy of a version-4 UUID
A UUID is 128 bits written as 32 hexadecimal digits in five hyphen-separated groups of 8, 4, 4, 4 and 12, for 36 characters in total. For example:
3f0c9a2e-7b1d-4c5a-9e8f-1a2b3c4d5e6f
- The first digit of the third group is always 4, the version number.
- The first digit of the fourth group is always 8, 9, a or b, which encodes the variant defined in the standard.
- Every other digit is random.
Output is lowercase, as the current standard, RFC 9562, recommends; software should compare UUIDs case-insensitively. Two special values are not random at all: the nil UUID, 00000000-0000-0000-0000-000000000000, often used as a placeholder, and the max UUID with every digit set to f.
How unlikely is a duplicate?
With 122 random bits there are about 5.3 × 10^36 possible version-4 values. By the birthday calculation you would need roughly 2.7 × 10^18 of them for a 50% chance that any two match, which at a billion UUIDs per second takes about 86 years. Real-world duplicates come from broken random generators, not from the maths, which is why this page relies on the browser's secure generator rather than Math.random().
UUID, GUID and the other versions
GUID is Microsoft's name for the same 128-bit format. .NET and SQL Server often display GUIDs in capitals, sometimes wrapped in braces, but the value is identical. RFC 9562, published in 2024, replaced the older RFC 4122 and added versions 6, 7 and 8:
| Version | Built from | Typical use |
|---|---|---|
| v1 | Timestamp and node ID | Legacy systems |
| v4 | Random bits | General-purpose IDs |
| v7 | Unix time in milliseconds plus random bits | Database keys that sort by creation time |
This page produces v4 only. If a table's primary key index suffers from random inserts, v7 is worth considering because new values arrive in roughly ascending order.
Practical uses and storage tips
- Primary keys created in an app before the record reaches the database, which suits offline-first apps.
- Idempotency keys sent with payment or order requests, so a retried request is not processed twice.
- Correlation IDs that tie together log lines from several services, test fixtures, and unique upload file names.
PostgreSQL has a native uuid type that stores 16 bytes. In MySQL, BINARY(16) with UUID_TO_BIN() takes far less space than CHAR(36). Need more than five? Click again for another batch. RFC 9562 warns against assuming UUIDs are hard to guess, so for secret tokens use the Password Generator.