How to generate a UUID
- Pick a version: v4 (random) is the right default. Use v7 for a sortable, time-ordered ID, or v5/v3 if the same input must always produce the same UUID.
- For v1/v4/v7, set How many (1 to 1,000) and press Generate. For v5/v3, choose a Namespace and type one or more names, one per line.
- Choose a format: lowercase or UPPERCASE, with or without hyphens, wrapped in
{braces}(the classic Windows GUID style), quoted, a JSON array, or a ready-to-paste SQL list. - Press Copy all, or Download .txt to save the batch.
Bulk UUID generation, in any format
Generate up to 1,000 UUIDs at once. Three v4 UUIDs from this generator, as an example:
44798398-a597-4f1e-8790-a52bc0e0144b
db3b0ad7-20bb-4d45-816b-ad6d21336f25
9401ca11-977a-4dc0-990e-fd16acd1f0d9The same three, formatted differently. Braces (the style Windows and .NET use for a GUID literal):
{44798398-a597-4f1e-8790-a52bc0e0144b}As a SQL list, ready to paste into an INSERT or a WHERE id IN (…):
('44798398-a597-4f1e-8790-a52bc0e0144b'),
('db3b0ad7-20bb-4d45-816b-ad6d21336f25');UUID v1, v3, v4, v5 and v7 — which to use?
| Version | What it encodes | Sortable? | Best for |
|---|---|---|---|
| v4 | 122 random bits | No | Tokens, IDs, file names — the default choice |
| v7 | 48-bit timestamp + random bits | Yes, by creation time | Database primary keys, log/event IDs |
| v1 | Timestamp + clock sequence + node | Roughly | Legacy systems; v7 is the modern replacement |
| v5 | SHA-1 of a namespace + name | No | A stable ID derived from a URL, email or other name |
| v3 | MD5 of a namespace + name | No | Same as v5, only when v3 is specifically required |
UUID vs GUID: what's the difference?
None. GUID ("Globally Unique Identifier") is Microsoft's name for the exact same 128-bit format the UUID standard defines — Windows, .NET and SQL Server call it a GUID, everyone else calls it a UUID, and the two are interchangeable. A "GUID generator" and a "UUID generator" produce identical output; this tool works as either, including the curly-brace {…} format .NET and Windows tools typically display a GUID in.
Can UUIDs collide?
Practically, no — for a random v4 UUID, 122 bits are random (the other 6 are fixed as the version and variant), giving 2122 (about 5.3 × 1036) possible values. Even generating a billion UUIDs every second, it would take roughly 1019 years before there's a 50% chance of a single collision (the "birthday problem"). Real collisions almost always trace back to a weak random number generator, not bad luck — which is why this tool draws every random bit from the Web Crypto API's crypto.getRandomValues(), never Math.random(), which was never designed to be unpredictable.
What is UUID v7?
UUID v7 (RFC 9562 §5.7, finalized in 2024) is a time-ordered UUID: its first 48 bits are the Unix timestamp in milliseconds, so v7 UUIDs generated later always sort after ones generated earlier — as plain strings, not just as numbers. Three v7 UUIDs generated together, already in creation order:
01a0de90-9dca-7230-aaf4-b7c900f5b5ae
01a0de90-9dca-7231-87e6-582107253e8c
01a0de90-9dca-7232-9747-7dc788d056aeThis generator gives each UUID in a batch a strictly increasing counter when several are created in the same millisecond, so a bulk batch is always fully sorted, not just "usually." Need the timestamp back out of a v7 UUID? Paste it into the inspector above, or convert the millisecond value further with the Unix timestamp converter.
Validate and inspect a UUID
Paste any UUID into the inspector above (hyphenated, bare hex, {braced}, any case) to see its version, its variant, and — for v1 and v7 — the moment it was created. The worked example from RFC 9562 itself, 017f22e2-79b0-7cc3-98c4-dc0c0c07398f, is version 7, variant RFC 4122 / 9562, and its embedded timestamp decodes to 2022-02-22T19:22:22.000Z. A UUID that fails to parse (wrong length, invalid characters) is reported as invalid rather than silently accepted.
Nil UUID and Max UUID
Two UUIDs are reserved as sentinels rather than identifiers:
- Nil UUID —
00000000-0000-0000-0000-000000000000— every bit is 0. RFC 9562 §5.9 defines it to mean "no UUID," similar tonull. - Max UUID —
ffffffff-ffff-ffff-ffff-ffffffffffff— every bit is 1. RFC 9562 §5.10 (new in the 2024 revision) defines it as a value greater than every other UUID, useful as an exclusive upper bound in a range query.
Paste either into the inspector above: both are flagged directly, with no version or variant to report.
Namespace UUIDs (v3, v5): the same name, every time
Unlike v1/v4/v7, versions 3 and 5 are deterministic: hashing the same namespace and name always gives the same UUID, which is useful when you need to derive a stable ID from something you already have (a URL, an email address, a product code) instead of storing a randomly generated one. Hashing the DNS namespace with the name example.com:
| Version | Hash | UUID |
|---|---|---|
| v5 | SHA-1 | cfbff0d1-9375-5685-968c-48ce8b15ae17 |
| v3 | MD5 | 9073926b-929f-31c2-abc9-fad77ae3e8eb |
This matches what Python's uuid.uuid5(uuid.NAMESPACE_DNS, "example.com") and uuid.uuid3(...) return, because both implement the same RFC 9562 algorithm. Prefer v5 over v3 for anything new; MD5 is only kept for compatibility with older systems that expect it.
Generate a UUID in JavaScript, Python and SQL
JavaScript: crypto.randomUUID() gives a v4 in any modern browser or Node.js 19+, no library needed. Python: uuid.uuid4() for random, uuid.uuid5(uuid.NAMESPACE_DNS, "example.com") for namespace-based (matches the table above exactly). PostgreSQL: gen_random_uuid(). MySQL: UUID(). SQL Server: NEWID(), or NEWSEQUENTIALID() for a sortable one.
Related developer tools
- Unix timestamp converter: decode a v7 UUID's embedded millisecond timestamp further, in any time zone.
- JSON formatter & validator: format an API response that returns UUIDs as IDs.
- Lorem Ipsum generator: placeholder text to pair with placeholder IDs while you build a UI.
Frequently asked questions
What is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit number, usually written as 32 hex digits in five groups (8-4-4-4-12), such as 123e4567-e89b-12d3-a456-426614174000. It identifies something — a database row, a session, a file — without a central registry or a counter, because the odds of two systems generating the same one by chance are astronomically small. RFC 9562 (2024) defines the current standard, replacing RFC 4122.
UUID vs GUID: what is the difference?
None, in practice. GUID (Globally Unique Identifier) is Microsoft's name for the same 128-bit format defined by the UUID standard; Windows, .NET and SQL Server call it a GUID, everyone else calls it a UUID. Both look and behave identically, and this generator can produce either — "GUID generator" and "UUID generator" are the same tool.
What is UUID v7 and why use it?
UUID v7 (RFC 9562 §5.7) puts the current Unix millisecond timestamp in the first 48 bits, so v7 UUIDs sort chronologically as plain strings or bytes — unlike v4, which is fully random and unordered. That makes v7 a much better database primary key: new rows insert at the end of an index instead of scattering randomly, which is kinder to the index's cache and page layout. For example, 017f22e2-79b0-7cc3-98c4-dc0c0c07398f (the worked example from RFC 9562) decodes to timestamp 2022-02-22T19:22:22.000Z — check any UUID's timestamp with the inspector above, or convert it further with the Unix timestamp converter.
Can UUIDs collide?
Practically, no. A random v4 UUID has 122 random bits (6 bits are fixed as the version and variant), so there are 2^122 (about 5.3 × 10^36) possible values. Even generating a billion UUIDs a second, you would need roughly 10^19 years before a 50% chance of one collision (the "birthday problem"). Collisions are a real risk only if the random number generator is weak — which is why this tool always uses the browser's cryptographic Web Crypto API, never Math.random.
Which UUID version should I use?
v4 (random) for almost everything: session tokens, file names, request IDs, anything where you just need "a unique value now." v7 (time-ordered) for database primary keys and anything you will query or sort by creation time. v5 (namespace + name, SHA-1) when the same input should always produce the same ID, for example turning a URL or email address into a stable key. v3 is the same idea as v5 but with the weaker MD5 hash; use it only if something you integrate with specifically requires v3. v1 (time + a node ID) is mostly legacy today — v7 does the same job better and leaks less information.
Are these UUIDs cryptographically secure?
The random bits in v1, v4 and v7 come from the Web Crypto API (crypto.getRandomValues), a cryptographically secure random number generator, never Math.random (which is not designed to be unpredictable). v3 and v5 are not random at all — they are deterministic hashes of a namespace and a name, so anyone who knows the name can compute the same UUID; don't use v3/v5 for anything that needs to stay secret, like a password reset token.
What is the nil UUID, and what is the max UUID?
The nil UUID, 00000000-0000-0000-0000-000000000000, has every bit set to 0; RFC 9562 §5.9 defines it to mean "no UUID" or "not set", the UUID equivalent of null. The max UUID, ffffffff-ffff-ffff-ffff-ffffffffffff, has every bit set to 1 (RFC 9562 §5.10, added in 2024); it is a sentinel meaning "greater than every other UUID", useful as an exclusive upper bound in range queries. Neither has a version or a real timestamp — paste either into the inspector above to see it flagged.
How do I generate a UUID in JavaScript, Python or SQL?
JavaScript/Node.js: crypto.randomUUID() for v4 (built into every modern browser and Node 19+). Python: uuid.uuid4() for random, uuid.uuid5(uuid.NAMESPACE_DNS, "name") for namespace-based (this page's v5 example, example.com, matches Python's output exactly). PostgreSQL: gen_random_uuid() (v4) or the uuid-ossp extension. MySQL: UUID() generates a v1. SQL Server: NEWID() (v4) or NEWSEQUENTIALID() for a sortable one, similar in spirit to v7.
Is my data sent anywhere when I generate UUIDs here?
No. Every UUID is generated by JavaScript running on your device; nothing is sent to a server, logged or saved. For v3/v5, the namespace and names you type are only used locally to compute the hash — they are never stored, even in your browser, because a name-based UUID can reveal what the name was.