What is a UUID?
A UUID (universally unique identifier, also called a GUID) is a 128-bit ID written as 32 hexadecimal characters in five groups, like 3f2b8c1e-9d4a-4c6f-8b2e-7a1d5e9c0b44. The chance of two random UUIDs ever matching is so small that they can be generated anywhere without checking a central list.
Version 4 or version 7?
| UUID v4 | UUID v7 | |
|---|---|---|
| Made from | 122 random bits | Timestamp + random bits |
| Sort order | Random | By creation time |
| Best for | Tokens, file names, general IDs | Database primary keys |
Random v4 keys get inserted all over a database index, which slows large tables. Version 7 IDs increase over time, so new rows go at the end of the index, like an auto-increment number, while staying unique across servers.
Are these UUIDs secure?
They are made with your browser's cryptographic random generator (crypto.getRandomValues), the same source used for security keys. Even so, don't rely on a UUID alone as a password or secret link where guessing would cause harm.
Formats
Upper or lower case, with or without hyphens, and with braces like {…} for Microsoft tools: all represent the same value. Lower case with hyphens is the standard form.