About the UUID Generator
Use the UUID generator to make random v4 or time-ordered v7 UUIDs, one or up to 1,000 at a time, in lowercase, uppercase, without hyphens or in braces for a Windows GUID. Paste any UUID into Check a UUID to see its version and, for v1, v6 and v7, the moment it was created.
A UUID (universally unique identifier) is a 128-bit ID written as 32 hex digits in five groups, like a0dab8ef-e0bf-408e-b985-13eafe6e7fb9. Any machine can make one without asking a central server, and two random ones won't match in practice. GUID is Microsoft's name for the same thing. The IDs are made in your browser with the Web Crypto random generator. An AI agent connected to toolo's MCP server can request them with generate_uuid.
- Choose UUID v4 (random) or UUID v7 (time-ordered). Five UUIDs appear when the page opens, and you get a new batch whenever you change the version or the count.
- Set How many, from 1 to 1000. Click Generate for a fresh batch with the same settings.
- Change the format with Uppercase, Hyphens (off gives 32 plain hex digits) and {Braces} (the Windows registry style). The switches reformat the current batch without making new IDs.
- Click Copy for the whole list, one UUID per line, or Download to save it as
uuid-v4.txtoruuid-v7.txt. - To read an ID you already have, paste it into Check a UUID. You get Canonical (lowercase with hyphens), Version, Variant and, for v1, v6 and v7, Created in UTC and your local time. Braces, uppercase, missing hyphens and a
urn:uuid:prefix are fine.
InputUUID v4 (random)
How many: 3Outputa0dab8ef-e0bf-408e-b985-13eafe6e7fb9
0767ec8f-3279-4054-a9c5-0f063feac215
cea499b5-6e33-4c39-957b-81bca1c5546aThe 4 that starts the third group is the version, and the first digit of the fourth group (8, 9, a or b) is the variant. The rest is random.
InputUUID v7 (time-ordered)
How many: 3Output01a1163c-1a00-747a-8da2-6e34a92aa121
01a1163c-1a01-73d3-89f6-4d226f3e5a7b
01a1163c-1a01-7f53-977c-173c02feb5e0Made at 2026-10-07T12:00:00.000Z and .001Z. The first 12 hex digits are the time. The last two share a millisecond, so their order is random; here they happen to sort correctly.
Input{C232AB00-9414-11EC-B3C8-9F6BDECED846}OutputCanonical c232ab00-9414-11ec-b3c8-9f6bdeced846
Version 1
Variant RFC 9562
Created 2022-02-22T19:22:22.000ZThe v1 test value from RFC 9562. A v1 counts 100-nanosecond steps since 15 October 1582 and stores the low bits first, so it doesn't sort by time.
UUID format and versions
RFC 9562 (2024) is the current UUID standard; it replaced RFC 4122. The 128 bits are written as hex in groups of 8-4-4-4-12. The first digit of the third group is the version, and the first digit of the fourth group shows the variant: 8, 9, a or b for standard UUIDs. Uppercase and lowercase mean the same ID, though most systems print lowercase.
- v1: a timestamp plus a node ID, often the MAC address, so it shows when and where it was made.
- v3 and v5: a hash of a namespace and a name (MD5 or SHA-1). The same name always gives the same UUID.
- v4: 122 random bits. The most common version, and what
crypto.randomUUID()returns. - v6: v1 with the time bits reordered so it sorts by time.
- v7: a 48-bit Unix time in milliseconds, then 74 random bits. It sorts by creation time; RFC 9562 recommends it over v1 and v6.
- v8: a free layout for vendor-specific IDs.
- Nil (
00000000-0000-0000-0000-000000000000) and Max (ffffffff-ffff-ffff-ffff-ffffffffffff): special values, often meaning "no ID" or "unset".
UUID v4 or v7?
Pick v7 for database primary keys. A v4 lands at a random spot in a B-tree index, so inserts touch pages across the whole index and slow down as the table grows. A v7 starts with the time, so new rows go to the end of the index, like an auto-increment number.
Pick v4 when the ID must not reveal anything. Anyone can read a v7's creation time, as Check a UUID shows, so a v7 in a public URL tells people when an account or order was created.
The v7 values here are random after the timestamp, so IDs from the same millisecond aren't in creation order. RFC 9562 allows this. For strict order inside one process, use a library that adds a counter (RFC 9562, section 6.2).
Name-based UUIDs (v3 and v5)
When the same input must always give the same ID, for example one ID per URL across several services, use v5. Python's uuid.uuid5(uuid.NAMESPACE_DNS, "www.example.com") always returns 2ed6657d-e927-568b-95e1-2665a8aea6a2, the test value from RFC 9562, which prefers v5 over v3. The generator here doesn't create v3 or v5, but Check a UUID reads their version.
Validate a UUID
To accept only standard UUIDs of versions 1 to 8, match ^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ without case sensitivity. It rejects braces, missing hyphens and the Nil and Max values. Try it on your own data in the Regex Tester.
Storing UUIDs in a database
Store UUIDs as 16 bytes, not as 36 characters of text. PostgreSQL has a native uuid type. In MySQL, use BINARY(16) with UUID_TO_BIN() and BIN_TO_UUID(); MariaDB 10.7 and later has its own UUID type. SQL Server's uniqueidentifier sorts by the last group first, so a v7 there doesn't keep inserts in order; NEWSEQUENTIALID() is the SQL Server way to get that.
Generate UUIDs in code
Use the built-in function or a well-known library. Don't build UUIDs from Math.random().
crypto.randomUUID(); // v4, browsers and Node.js 19+import uuid
uuid.uuid4()
uuid.uuid7() # Python 3.14+
uuid.uuid5(uuid.NAMESPACE_DNS, "www.example.com")id := uuid.New() // v4
id7, err := uuid.NewV7() // v7UUID.randomUUID(); // v4Guid.NewGuid(); // v4
Guid.CreateVersion7(); // v7, .NET 9+Uuid::new_v4();
Uuid::now_v7();require "securerandom"
SecureRandom.uuid # v4Ramsey\Uuid\Uuid::uuid4()->toString();SELECT gen_random_uuid(); -- v4, PostgreSQL 13+
SELECT uuidv7(); -- v7, PostgreSQL 18+SELECT UUID(); -- v1
SELECT UUID_TO_BIN(UUID(), 1); -- 16 bytes, time parts moved firstuuidgen
cat /proc/sys/kernel/random/uuid # Linux, v4Is a UUID the same as a GUID?
Yes, GUID is Microsoft's name for it, and the text format is the same. Windows often shows them uppercase in braces. One catch: .NET's Guid.ToByteArray() writes the first three groups in little-endian byte order.
Can two UUIDs ever be the same?
In theory, yes. A v4 has 122 random bits, and you'd need about 2.7 × 10^18 of them for a 50% chance of one duplicate: 86 years at a billion per second. Real duplicates come from broken random generators or cloned VM snapshots.
Can I use a UUID as a secret token or API key?
No. RFC 9562 warns against assuming UUIDs are hard to guess, and a v7 even shows when it was made. Make a long random token instead; the Password Generator can create one.
How do I get the timestamp from a UUID v7?
The first 12 hex digits are milliseconds since 1970-01-01 UTC. Paste the UUID into Check a UUID, or convert them yourself: parseInt("017f22e279b0", 16) is 1645557742000, which the Unix Timestamp Converter shows as 2022-02-22T19:22:22Z.
Should I use UUIDs or auto-increment IDs?
Auto-increment IDs are smaller, but they reveal how many rows you have and only the database can hand them out. UUIDs can be made anywhere, before the insert. If you pick UUIDs for keys, use v7.
Which UUID version does MySQL UUID() return?
Version 1, with a timestamp and a node ID instead of random bits. For random or sortable IDs, make v4 or v7 in your application.