UUID Generator
Generate one UUID or a batch of up to 1,000 identifiers. Choose a version, set the count and copy the result. For v3 and v5, supply a namespace and name to create a repeatable identifier.
How to generate a UUID
- Choose the UUID version using the table below.
- For v1, v4, v6 or v7, set a count from 1 to 1,000. For v3 or v5, choose a namespace and enter a name.
- Select Generate UUID, then Copy All.
Generation happens in your browser. Input names and generated values are not sent to our server.
Which UUID version should I choose?
| Version | Contents | Typical use |
|---|---|---|
| v1 | Timestamp, sequence and node identifier | Compatibility with systems requiring v1. This tool uses a random node value instead of your device’s MAC address. |
| v3 | MD5 hash of a namespace and name | Repeatable IDs and compatibility with an existing system. |
| v4 | Random bits | Random identifiers without a timestamp. |
| v5 | SHA-1 hash of a namespace and name | Repeatable IDs derived from names such as domains or URLs. |
| v6 | Reordered v1 timestamp | Time ordering with a v1-related structure. |
| v7 | Unix time in milliseconds and additional bits | Identifiers ordered by their encoded time. |
Choose v4 for a general random ID. Consider v7 when time ordering is useful. Database performance depends on the database, indexing and workload; choosing a version does not guarantee a particular speed improvement.
Versions v3 and v5 map known inputs to repeatable UUIDs. Their hash algorithms are part of the format; these versions are not intended to generate secrets.
What is a UUID?
A UUID is a 128-bit identifier, usually written as 32 hexadecimal digits in groups of 8–4–4–4–12:
f47ac10b-58cc-4372-a567-0e02b2c3d479
The first digit of the third group indicates the version: this example is v4. Inspect an existing identifier’s version, variant and any encoded time with the UUID decoder.
Custom dates and times
For v1, v6 and v7, the Timestamp field accepts a custom date and time in your browser’s local time zone. This can help prepare test data or migrate historical timestamps.
An encoded timestamp does not independently prove when a record was created. Using the same time again also does not produce the same UUID: other bits or sequence values contribute to the result.
Namespaces for v3 and v5
Choose DNS for domain names, URL for web addresses, OID for object identifiers or X.500 for distinguished names. For example, select DNS and enter example.com.
The same version, namespace and exact name produce the same UUID. Keep the spelling consistent between systems. These modes return one value, because repeating the same input in a batch would repeat the same identifier. The original name cannot be directly decoded from the result.
Uniqueness and security
This generator obtains random values through crypto.getRandomValues(). A collision between independently generated v4 UUIDs is very unlikely, but possible. Deterministic v3 and v5 UUIDs can also collide for different inputs. Use database uniqueness constraints and handle conflicts.
An ID must not replace an access-control check. For secret keys in your own application, use the password and key generator and your application’s authentication requirements.
Common questions
How many UUIDs can I create at once?
Up to 1,000 for v1, v4, v6 and v7. Versions v3 and v5 return one value from the supplied namespace and name.
Does a UUID contain my MAC address?
Versions v1 and v6 have a node identifier field. This browser tool fills it with a random value. Other generators may use a different method; check their implementation before making assumptions.
Can I find a creation date in UUID v4?
No. UUID v4 does not contain a timestamp. Versions v1, v6 and v7 can contain time information.
Why does v3 or v5 keep returning the same UUID?
These versions are deterministic: the same version, namespace and name produce the same value. Choose v4 for a new random identifier.
Implementation in Different Languages
These examples show identifier generation in several languages. The page’s generator supports versions 1, 3, 4, 5, 6 and 7; language examples below focus on the indicated versions.
JavaScript/TypeScript
// UUID v4 - Easiest way (modern browsers)
const uuid = crypto.randomUUID();
// UUID v4 - Manual implementation
function generateUUIDv4() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
const r = (crypto.getRandomValues(new Uint8Array(1))[0] & 0x0f) >> (c === 'x' ? 0 : 2);
const v = c === 'x' ? r : (r & 0x3) | 0x8;
return v.toString(16);
});
}
Python
The standard library’s v1 generator may use a different node-identifier method from this browser tool.
import uuid
# UUID v4
uuid_v4 = str(uuid.uuid4())
# Example output: 'f47ac10b-58cc-4372-a567-0e02b2c3d479'
# UUID v1
uuid_v1 = str(uuid.uuid1())
Java
import java.util.UUID;
// UUID v4
String uuidV4 = UUID.randomUUID().toString();
C#
using System;
// UUID v4
Guid uuid = Guid.NewGuid();
string uuidString = uuid.ToString();