UUID Generator
Copy a random UUID v4 or generate a batch of v4 or time-based v1 identifiers.
Generate UUID values
Format
Which UUID version do I need?
- v4 gives you a fresh random ID for a record, request or test fixture.
- v1 includes a timestamp. Use it when an existing system requires this version.
- For repeatable IDs, use the name-based UUID v5 generator.
- For IDs that sort by creation time, use the UUID v7 generator.
Compare UUID v1, v4 and v7 for database keys and public IDs.
Generate a UUID v4 in JavaScript
On an HTTPS page, the browser has a built-in UUID generator.
const id = crypto.randomUUID();In Python, import uuid and call uuid.uuid4().
In C#, call Guid.NewGuid(). The GUID generator shows how .NET formats the result with or without braces.
How can I recognize a UUID v4?
In f47ac10b-58cc-4372-a567-0e02b2c3d479, the third group starts with 4, the version. The fourth starts with a variant digit, one of 8, 9, a or b.
That leaves 122 random bits. Independent random UUIDs can collide, although this is very unlikely at typical application volumes.
A GUID is another name for a UUID. Check the version of a UUID or GUID.