UUID Generator
Create one UUID or thousands. Choose random version 4 or time-ordered version 7, set the style, then copy them or download a text file. Paste any UUID to see its version. Everything is made in your browser.
Check a UUID
UUID versions
| Version | How it is made | Typical use |
|---|---|---|
| 1 | Time and the computer's network address | Older systems |
| 3 and 5 | A hash of a name (MD5 or SHA-1) | The same ID every time for the same name |
| 4 | Random numbers | The most common choice for general IDs |
| 6 | Version 1 with the time reordered | Sortable IDs from version 1 systems |
| 7 | Unix time in milliseconds plus random digits | Database keys that sort by creation time |
| Nil | All zeros | A placeholder meaning no value |
What a UUID looks like
A UUID has 32 hexadecimal digits in five groups, 8-4-4-4-12, for example 018f3c2e-7b1a-7c4d-9a2b-3f5e6d7c8b9a. The first digit of the third group is the version (4 or 7 here). The first digit of the fourth group (8, 9, a or b) is the variant, which shows that it follows the standard.
How to make a UUID in code
| Language or tool | Code |
|---|---|
| JavaScript | crypto.randomUUID() |
| Python | import uuid; str(uuid.uuid4()) |
| Java | UUID.randomUUID().toString() |
| C# / .NET | Guid.NewGuid().ToString() |
| PostgreSQL | SELECT gen_random_uuid(); |
| Linux and macOS terminal | uuidgen |
Choosing between v4 and v7
- Use version 4 when you want an ID that reveals nothing about when it was created.
- Use version 7 for database primary keys: new rows are added at the end of the index, which is faster and keeps the table compact.
- Version 7 contains the creation time, so do not use it where that would be a privacy problem.
How to use the UUID Generator tool
- Choose Version 4 (random) or Version 7 (time-ordered), and how many you need.
- Pick the style: upper case, with or without hyphens, in curly braces.
- Press the copy button or download the list. Press Generate new for a fresh set.
Frequently asked questions
What is a UUID?
A UUID (universally unique identifier) is a 128-bit number written as 32 hexadecimal digits in groups, such as 550e8400-e29b-41d4-a716-446655440000. It is used as an ID for database rows, files, requests and devices without needing a central place to hand out numbers.
What is the difference between UUID v4 and v7?
Version 4 is completely random. Version 7 starts with the creation time in milliseconds and then random digits, so new UUIDs sort after older ones. That makes version 7 much friendlier to database indexes, while version 4 reveals nothing about when it was made.
Can two UUIDs ever be the same?
In practice, no. A version 4 UUID has 122 random bits, so you would need to generate billions every second for many years before a repeat became likely. These are made with your browser's secure random number generator.
Is a UUID the same as a GUID?
Yes. GUID (globally unique identifier) is the name Microsoft uses for the same thing. Microsoft tools often show GUIDs in upper case and in curly braces, which you can switch on here.
Can I use a UUID as a password or secret?
No. A UUID is made to be unique, not secret. Use the Password Generator for passwords and tokens that must be hard to guess.