How to generate a UUID
- The page makes a UUID as soon as it opens, and a new one whenever you change an option or press Generate new.
- Pick v4 for a purely random identifier, or v7 when the identifiers should sort by creation time (good for database keys).
- Set How many (1 to 100), then choose the format: hyphens, upper case, braces.
- Press Copy next to one UUID, or Copy all for one per line.
Three version 4 UUIDs drawn once when this page was written (a seeded example; the page itself always uses your browser's secure generator):
140f0223-3d66-4b98-9184-1f1c638639ec af300a29-c1bd-4809-bcc9-d8a4c9c01f1f d19c84ff-8ec7-4804-a57d-81242503d14a
What is a UUID?
A UUID (universally unique identifier, also called a GUID in the Microsoft world) is a 128-bit number written as 32 hexadecimal digits in five groups, 8-4-4-4-12. It lets separate systems create identifiers without asking a central server, with a collision chance so small it is ignored in practice. The format is defined in RFC 9562 (2024), which replaced RFC 4122.
Two characters tell you what you have: the first digit of the third group is the version (4 or 7 here) and the first digit of the fourth group is the variant (8, 9, a or b for the standard layout). Every UUID this page makes follows that rule.
Version 4 versus version 7
| v4 | v7 | |
|---|---|---|
| Made from | 122 random bits | 48-bit Unix time in milliseconds, then 74 random bits |
| Sorts by creation time | No | Yes, to the millisecond |
| Reveals creation time | No | Yes, anyone can read it from the first 12 digits |
| Best for | Tokens, correlation IDs, anything that must not leak time | Database primary keys and logs, where ordered inserts keep indexes compact |
Random v4 keys scatter across a B-tree index, which makes inserts into big tables slower and fragments pages. v7 keys arrive in roughly increasing order, so they behave like an auto-increment id while staying globally unique. Pick v4 when the time of creation is a secret, v7 when index locality matters.
How unlikely is a collision?
A v4 UUID has 122 random bits, about 5.3 × 1036 possible values. You would have to generate a billion UUIDs every second for about 85 years to reach a 50% chance of a single duplicate. For a table of a billion rows the chance of any duplicate is around 10-19. In other words, the collision risk is far below the risk of a disk error or a bug.
That only holds when the random bits are really random. This page draws each byte with crypto.getRandomValues and unbiased sampling; a weak generator such as Math.random in old libraries is a known source of collisions in the wild.
Using UUIDs in code
- JavaScript:
crypto.randomUUID()returns a v4 UUID in all modern browsers and in Node.js 14.17 and later. - Python:
import uuid; uuid.uuid4(). Version 7 arrived in the standard library with Python 3.14. - Databases: PostgreSQL has a native
uuidtype (16 bytes); store it as that, not as a 36-character string. Usegen_random_uuid()for v4. - Formats: .NET and Windows tools often show upper case with braces,
{F47AC10B-58CC-4372-A567-0E02B2C3D479}; the Braces and Upper case options above produce exactly that.
A UUID is an identifier, not a secret: do not use one as a password or a session token without more random data. For passwords use the password generator; for a fingerprint of a file or text use the hash generator.
Related tools
- Password generator – strong random passwords instead of identifiers
- Hash generator – MD5 and SHA hashes of any text
- Base64 encode and decode – encode a UUID or any text as Base64
- Random number generator
UUID generator FAQ
Is this UUID generator random and safe?
Yes. Each UUID is built from your browser's cryptographic random generator and is never sent anywhere or stored. Nothing about it reaches a server.
What is the difference between a UUID and a GUID?
They are the same 128-bit identifier. GUID is the name used in Microsoft products, usually written in upper case with braces. Use the Upper case and Braces options for that look.
Can two UUIDs ever be the same?
In theory yes, in practice no. A version 4 UUID has 122 random bits, so you would need to generate about a billion per second for roughly 85 years to have a 50% chance of one duplicate.
Which should I use, v4 or v7?
Use v4 when the identifier must not reveal when it was created. Use v7 for database keys and logs, because it sorts by creation time and keeps indexes compact.
Why does a v7 UUID start with the same digits?
The first 12 hex digits of a v7 UUID are the Unix time in milliseconds, so UUIDs made at the same moment share them. The rest is random.
Can I generate many UUIDs at once?
Yes, up to 100 at a time. Press Copy all to get them one per line, ready to paste into a spreadsheet or script.
Is a UUID a good password or secret token?
No. A UUID is meant to be unique, not secret. A v4 UUID has 122 random bits, but its format is well known and libraries sometimes use weaker generators. Use a password generator for secrets.