Need a unique ID for a database row, an API request, or a filename? Generate UUID v4 or time-ordered UUID v7 above, copy one or hundreds, and toggle hyphens, uppercase, or braces for GUID-style output. This UUID generator is part of the programming tools on TechOpt.io.
What this UUID generator means by UUID vs GUID
A UUID (Universally Unique Identifier) is a 128-bit value, specified in RFC 9562. GUID (Globally Unique Identifier) is Microsoft’s name for the same thing. The bits are identical; only the usual spelling changes. UUIDs are often lowercase with hyphens. GUIDs are often uppercase, and Windows tools sometimes wrap them in braces: {550E8400-E29B-41D4-A716-446655440000}.
UUID versions
This tool generates v4 (random) and v7 (Unix time plus random), the two you want for new work. Other versions still show up in older systems:
| Version | Layout | Typical use |
|---|---|---|
| v1 | Timestamp plus MAC address | Legacy. Can leak the machine address, so skip it for new IDs. |
| v4 | 122 bits of random data | Default unique IDs when order does not matter. |
| v7 | Unix milliseconds plus random (RFC 9562) | IDs that should sort in creation order — kinder to database indexes. |
v3 and v5 still exist for name-based IDs: they hash a namespace UUID plus a name (MD5 for v3, SHA-1 for v5). This generator does not emit those; if you need a stable ID from a string, hash it in your own code.
When to use v4 vs v7
Use v4 when you only need uniqueness: session tokens, object keys, anything that must not be guessable from nearby IDs. Use v7 when the IDs will be stored or queried in creation order. Random v4 values scatter across a B-tree index. v7 puts the time in the high bits, so inserts cluster and range scans stay cheap.
Formats: hyphens, 32-hex, uppercase, braces, URN
The canonical layout is eight, four, four, four, then twelve hex digits: 550e8400-e29b-41d4-a716-446655440000. APIs and filenames often want the 32-character form with no hyphens. Uppercase plus optional braces matches common GUID paste formats. The URN form is the same value with an urn:uuid: prefix. The validator above accepts all of these.
Collisions
A v4 UUID has 122 random bits. You would need to generate billions of IDs per second for centuries before a collision became likely. Treat a generated UUID as unique for application IDs, then still put a unique constraint on the column if it is a primary key — that is cheap insurance, not a vote of no confidence in the generator.
RFC 4122 and RFC 9562
RFC 4122 defined UUID versions 1 through 5. RFC 9562 updates that document and adds v6, v7, and v8. v7 is the time-ordered version meant for new systems: 48 bits of Unix time in milliseconds, a 4-bit version, then random bits (with a 2-bit RFC variant). This page generates v4 and v7 to that layout, in your browser.
Generate a UUID in code
The generator above is for a quick copy. In application code, use the standard library:
import uuid
print(uuid.uuid4())
print(uuid.uuid7()) # Python 3.13+
crypto.randomUUID(); // JavaScript, UUID v4
Guid.NewGuid(); // C# / .NET
FAQ
What is the difference between UUID v4 and v7?
UUID v4 is 122 bits of random data. UUID v7 (RFC 9562) puts a Unix timestamp in milliseconds in the first 48 bits, then random bits. v7 values sort in time order, which is kinder to database indexes. Use v4 when you only need uniqueness; use v7 when IDs will be stored or queried in creation order.
Is a GUID the same as a UUID?
Yes. GUID is Microsoft’s name for the same 128-bit identifier. A GUID is usually written in uppercase, sometimes with braces, for example {550E8400-E29B-41D4-A716-446655440000}. The bits are the same as a UUID.
How do I generate a UUID without hyphens?
Turn off Hyphens in the generator to copy a 32-character hex string such as 550e8400e29b41d4a716446655440000. That form is common in URLs, filenames, and APIs that reject the 8-4-4-4-12 layout.
Can two randomly generated UUIDs collide?
In practice, no. A v4 UUID has 122 random bits. You would need to generate billions of IDs per second for centuries before a collision became likely. Treat a generated UUID as unique for application IDs, then still enforce uniqueness in the database if the value is a primary key.
Does this UUID generator upload my values?
No. It runs entirely in your browser. Generated and pasted UUIDs never leave your machine.
How do I check if a UUID is valid?
Paste it into the validator. It accepts hyphenated, 32-hex, braced, and urn:uuid: forms. A valid UUID has 32 hexadecimal digits (optionally grouped 8-4-4-4-12). The validator reports the version, variant, and — for v7 — the embedded timestamp.
Why is UUID v7 sortable?
The first 48 bits are the Unix time in milliseconds, so later IDs compare greater than earlier ones. Sequential inserts cluster in B-tree indexes instead of scattering the way random v4 IDs do.
Looking for more developer how-tos? Browse the programming guides or the rest of the tools.