About UUIDs
A UUID (universally unique identifier), also called a GUID in the Microsoft world, is a 128-bit value used to label things like database rows, files, sessions, messages and API requests. Because UUIDs are so large, any machine can create one on its own without asking a central server and still be confident nobody else will ever produce the same value. That makes them a good fit for distributed systems, offline apps and anywhere you need an ID before a record reaches the database.
Reading a UUID
A UUID is written as 32 hexadecimal digits in five groups, 8-4-4-4-12, for example f47ac10b-58cc-4372-a567-0e02b2c3d479. The first digit of the third group is the version (here 4). The first digit of the fourth group is the variant; for standard UUIDs it is always 8, 9, a or b.
Version 4: random
This generator makes version 4 UUIDs. Apart from the 6 bits that mark the version and variant, all 122 remaining bits are random, which gives about 5.3 × 1036 possible values. To have even a one in a billion chance of a single duplicate you would need to generate around 100 trillion of them. The UUIDs here come from your browser's crypto.randomUUID(), which uses a cryptographically secure random source, and nothing is sent to a server.
Other versions
- Version 1 combines a timestamp with the machine's MAC address. It reveals when and where it was made.
- Versions 3 and 5 are hashes of a namespace and a name, so the same input always gives the same UUID.
- Version 7 (added in RFC 9562, 2024) starts with a Unix timestamp in milliseconds followed by random bits. Because new values sort after old ones, v7 keeps database indexes compact and is a good choice for primary keys.
The checker above tells you the version and variant of any UUID you paste in, and for time-based versions (1, 6 and 7) it shows when the UUID was created.
Formatting options
UUIDs are case-insensitive, and the standard says to output them in lowercase, but some systems such as Windows and SQL Server show them in uppercase. Removing the hyphens gives a compact 32-character form, and curly braces are the usual way to write GUIDs in Windows registry entries and .NET code.