Quick answer
A UUID (universally unique identifier) is a 128-bit value written as 32 hex digits in an 8-4-4-4-12 pattern, such as 017f22e2-79b0-7cc3-98c4-dc0c0c07398f. Version 4 is fully random; version 7 starts with a millisecond timestamp, so it sorts by creation time. In Playxoft's UUID generator, pick a version, choose how many you need, and copy or download them. Every UUID is generated locally by your browser's cryptographic random number generator.
- Version 4 and 7
- Bulk up to 1,000
- Monotonic v7 ordering
- JSON, CSV and SQL lists
- UUID inspector
- Timestamp decoding
- Copy and download
How to use the UUID Generator
- 1Choose Version 4 for a fully random UUID or Version 7 for one that sorts by creation time.
- 2Set How many you need, from 1 to 1,000. A fresh batch appears instantly; click Generate new or press R for another.
- 3Adjust the Format: hyphens, uppercase, braces, quotes and a list layout such as a JSON array, a CSV column or a SQL list.
- 4Click Copy for the highlighted UUID, or Copy all and Download for the whole batch.
- 5Paste any UUID into the UUID inspector to read its version, variant and embedded timestamp.
What is a UUID?
A UUID is a 128-bit identifier that any computer can create on its own, with no central registry, and still be practically certain nobody else will ever create the same one. The format is defined by RFC 9562, which replaced the older RFC 4122 in May 2024. Microsoft calls the same thing a GUID.
It is written as 32 hexadecimal digits in five groups, 8-4-4-4-12. Two digits carry metadata:
- The 13th digit is the version: the
7in017f22e2-79b0-7cc3-…means version 7. - The 17th digit holds the variant. For standard UUIDs its top two bits are
10, so it is always8,9,aorb.
The version says how the other bits were made:
| Version | How it is built | When to use it |
|---|---|---|
| v1 | 60-bit timestamp (100 ns ticks since 1582) + clock sequence + node, often the MAC address | Legacy only: it leaks the creating host and time |
| v3 | MD5 hash of a namespace UUID plus a name | Deterministic IDs from names; prefer v5 |
| v4 | 122 random bits | Opaque IDs where creation time should stay private |
| v5 | SHA-1 hash of a namespace UUID plus a name | The same name always maps to the same UUID |
| v6 | v1's fields reordered so the timestamp sorts first | Systems already built on v1; otherwise use v7 |
| v7 | 48-bit Unix timestamp in milliseconds + random bits | Database keys and anything sorted by creation |
| v8 | Custom layout; only the version and variant bits are fixed | Vendor-specific formats |
Version 2 (DCE Security) exists but is almost never used.
RFC 9562 also defines two special values: the nil UUID (all zeros), meaning "no value", and the max UUID (all f), a sentinel for things like range bounds. Paste either into the inspector above to see them recognized.
UUID v4 vs v7: which should I use?
Both are 128 bits and both are safe to generate anywhere. The difference is what fills the bits.
| UUID v4 | UUID v7 | |
|---|---|---|
| Contents | 122 random bits | 48-bit Unix timestamp (ms) + 74 random bits |
| Sort order | Random | Creation time |
| Database index inserts | Scattered across the whole B-tree | Appended near the end, like an auto-increment |
| Reveals | Nothing | When it was created, to the millisecond |
| Built in | Everywhere (crypto.randomUUID, uuid.uuid4) | Newer runtimes: Python 3.14, PostgreSQL 18, .NET 9 |
Use v7 for database primary keys and anything you sort or paginate by. Random v4 keys land on random pages of a B-tree index, so a large table suffers page splits and poor cache locality on every insert; v7 keys arrive in roughly ascending order, so new rows go to the same "hot" pages, much like a sequential integer key.
Use v4 when the ID is public and its creation time should stay private, for example a share link or an external reference. Anyone can read a v7's timestamp; paste one into the inspector to see it.
How does UUID v7 stay sorted within one millisecond?
A millisecond is a long time for a computer: this page can make a thousand v7 UUIDs inside one. If the bits after the timestamp were purely random, UUIDs from the same millisecond would sort in a random order.
RFC 9562 §6.2 describes several fixes. This generator uses method 1, a dedicated counter: the 12 bits after the version digit (rand_a) start at a random value with the top bit clear, and each UUID created in the same millisecond adds one. The rest stays random. Two edge cases are handled the way the RFC allows:
- If the counter would overflow, the timestamp is advanced by one millisecond.
- If the system clock jumps backwards, the last timestamp is reused, so the sequence never goes down.
Monotonic ordering is guaranteed per generator. UUIDs made on different machines in the same millisecond interleave in random order, which is still close enough to time order for indexes.
Can two UUIDs ever collide?
In theory yes, in practice no. A v4 UUID has 2^122 possible values (about 5.3 × 10^36). By the birthday bound, you would need roughly 2.7 quintillion (2.7 × 10^18) v4 UUIDs before the chance of even one duplicate reaches 50%.
Real-world duplicates come from broken randomness, not from the math: a Math.random() polyfill, two virtual machines restored from the same snapshot, or a forked process that copies its parent's generator state. Browsers' crypto.randomUUID() and crypto.getRandomValues(), which this tool uses, are cryptographically secure. To estimate risk for shorter IDs, try the collision calculator in the nanoid generator.
How should I store UUIDs in a database?
Store the 16 bytes, not the 36-character string. A native type is smaller, faster to compare and validates input for free:
- PostgreSQL: the
uuidtype (16 bytes).gen_random_uuid()makes v4; PostgreSQL 18 addsuuidv7(). - SQL Server:
uniqueidentifier. Note that it sorts by the last group first, so v7 values do not sort by time there. - MySQL:
BINARY(16)withUUID_TO_BIN()andBIN_TO_UUID().
In .NET, Guid.ToByteArray() writes the first three groups little-endian. When exchanging raw bytes with other systems, use ToByteArray(bigEndian: true) (.NET 8 and later).
How do I generate a UUID in code?
Most platforms have v4 built in, and v7 support is arriving quickly:
// JavaScript (browsers and Node.js 19+)
crypto.randomUUID(); // v4
# Python
import uuid
uuid.uuid4() # v4
uuid.uuid7() # v7, Python 3.14+
// Go — github.com/google/uuid
uuid.New() // v4
uuid.NewV7() // v7, returns (UUID, error)
// C# (.NET 9+)
Guid.NewGuid(); // v4
Guid.CreateVersion7(); // v7
-- PostgreSQL
SELECT gen_random_uuid(); -- v4
SELECT uuidv7(); -- v7, PostgreSQL 18+Generating the ID in your application rather than the database lets you know it before the insert, which simplifies creating related rows and retrying requests safely.
Frequently asked questions
Last updated by the Playxoft engineering team.