UUID Generator (v1, v4, v7 + Decoder)
Generate bulk UUIDs in any version — v4 random, v7 time-ordered, v1 timestamp — and decode any UUID to reveal its version and hidden timestamp. All in your browser.
UUID decoder & inspector
Paste any UUID to reveal its version, variant, and — for v1 and v7 — the exact creation timestamp hidden inside it.
TL;DR
Need an ID right now? Hit Generate — v4 is the safe default for tokens and one-off identifiers. Storing rows in a database? Switch to v7: it sorts by creation time and keeps your indexes fast. Paste any UUID into the decoder below to see its version and the timestamp hidden inside v1/v7.
What is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit label written as 32 hexadecimal digits in five groups — for example 550e8400-e29b-41d4-a716-446655440000. It is designed to be unique across space and time without asking any central authority, which is why it became the standard way to identify database rows, API resources, and distributed-system events. The current specification is RFC 9562 (published May 2024, obsoleting RFC 4122), which defines versions 1 through 8.
The version digit — the first character of the third group — tells you how the UUID was made: v4 means 122 bits of pure randomness, v7 means a millisecond timestamp followed by random bits, and v1 means an older-style timestamp plus a node identifier. This generator produces all three (plus the all-zeros Nil UUID) directly in your browser using your device’s cryptographically secure random source, and its decoder can read any UUID back apart to show you exactly what is inside.
UUID v4 vs v7: which should you use?
Short answer: v7 for database keys, v4 for everything else. Random v4 UUIDs scatter new rows randomly through a database index, forcing the engine to split pages and slowing inserts as the table grows. v7 fixes this by starting every UUID with the current Unix timestamp in milliseconds, so new rows land next to each other — inserts stay fast and ORDER BY id gives you chronological order for free.
| Property | v1 | v4 | v7 (RFC 9562) |
|---|---|---|---|
| How it is made | Timestamp + node id | 122 random bits | Unix-ms timestamp + 74 random bits |
| Sortable by time | Roughly (awkward layout) | No | Yes — string sort = time sort |
| Database index friendly | Poor | Poor (random inserts) | Excellent (sequential inserts) |
| Privacy | Leaks MAC + timestamp | Leaks nothing | Reveals creation time only |
| Best for | Legacy systems | Tokens, nonces, one-off ids | Primary keys, event ids, logs |
How likely is a UUID collision, really?
A version-4 UUID carries 122 random bits, giving about 5.3 × 10³⁶ possible values. By the birthday paradox, you would need to generate roughly 2.7 quintillion (2.7 × 10¹⁸) UUIDs before reaching even a 50% chance of a single duplicate. At a billion UUIDs per second, that takes around 85 years. In practice, collisions do not happen — you are far more likely to be struck by lightning while winning the lottery.
The realistic risks are elsewhere: using a weak random source (this tool uses your browser’s crypto.getRandomValues, which is cryptographically secure), reusing the same seed, or — with v1 — exposing your MAC address. v7’s timestamp is public by design, so keep v7 ids internal and use v4 for anything shown to end users where creation time should stay private.
How to generate a UUID in code
Most languages now generate UUIDs natively — no library needed:
Python
import uuid print(uuid.uuid4()) # v4 random print(uuid.uuid7()) # v7 time-ordered (Python 3.14+)
JavaScript
crypto.randomUUID(); // v4, built into every modern browser
Java
UUID id = UUID.randomUUID(); // v4 System.out.println(id);
Why UUIDv7 is taking over in 2026
RFC 9562 standardized v7 in May 2024, and the ecosystem has moved fast since. Python 3.14 ships uuid.uuid7() in the standard library, PostgreSQL 18 includes a native uuidv7() function for column defaults, and major ORMs and frameworks now recommend v7 for new projects. The driver is simple economics: at scale, the index fragmentation caused by random v4 primary keys costs real disk I/O and real money.
If you are starting a new project today, default to v7 for anything persisted and keep v4 for ephemeral identifiers. The v7 UUIDs from this generator are RFC 9562 compliant — 48-bit millisecond timestamp, version nibble 7, 74 bits of randomness — and monotonic within a session, so rapid bulk generation never produces out-of-order ids.
UUID vs GUID: what’s the difference?
Practically nothing. GUID (Globally Unique Identifier) is Microsoft’s name for the same 128-bit format. A GUID produced by Windows and a UUID v4 follow the same structure and are fully interchangeable — the terms differ by ecosystem, not by bits.
Related developer tools
Pair this with ToolsOfWeb's JWT Decoder to inspect tokens that carry UUID claims, the JSON Formatter to pretty-print API payloads full of ids, or the Base64 Converter when ids travel in encoded form. For a v7-only quick generator, see the UUIDv7 Generator.
FAQs
What is a UUID?+
A UUID (Universally Unique Identifier) is a 128-bit identifier written as 32 hexadecimal digits in five groups, like 550e8400-e29b-41d4-a716-446655440000. It is designed to be unique across space and time without a central registry, which is why databases, APIs, and distributed systems use UUIDs as primary keys.
UUID v4 vs v7: which should I use?+
Use v7 for anything stored in a database: its timestamp prefix keeps new rows physically close together, which makes inserts and range queries much faster. Use v4 for tokens, nonces, and one-off identifiers where ordering does not matter and you want maximum unpredictability. Both are safe, random, and standard.
What is the chance of two UUIDs colliding?+
Effectively zero. A version-4 UUID has 122 random bits — about 5.3 × 10³⁶ possible values. You would need to generate roughly 2.7 quintillion (2.7 × 10¹⁸) UUIDs to reach even a 50% chance of a single collision. Generating a billion UUIDs per second, that takes about 85 years.
UUID vs GUID: what is the difference?+
Almost none. GUID (Globally Unique Identifier) is Microsoft’s name for the same 128-bit format defined by RFC 9562. A GUID generated by Windows and a UUID v4 are structurally identical and interchangeable.
Which UUID version should I use for database primary keys?+
Version 7. Random v4 UUIDs scatter new rows randomly through a B-tree index, causing page splits and slower inserts. v7 starts with a millisecond timestamp, so new rows append near each other — PostgreSQL 18 even ships a native uuidv7() function, and Python 3.14 added uuid.uuid7() to the standard library.
More free tools
Want guides and tips? Visit the ToolsOfWeb blog or go back to the homepage.
