What Is a UUID? Versions, Format, and How They Work
A Unique Label You Can Generate Without Asking Anyone
A UUID (Universally Unique Identifier) is a 128-bit value used to label data so that two systems can each create identifiers without coordinating and still avoid collisions. You see them as primary keys in databases, request IDs in logs, and resource names in APIs. The same value is sometimes called a GUID (Globally Unique Identifier), which is Microsoft naming for the same 128-bit identifier, not a different format.
You can generate and decode UUIDs with our UUID Generator and Decoder, which runs entirely in your browser.
The 8-4-4-4-12 Format
A UUID is written as 32 hexadecimal digits split into five groups by hyphens, in the pattern 8-4-4-4-12, for 36 characters in total (for example f47ac10b-58cc-4372-a567-0e02b2c3d479). Those 32 hex digits encode 128 bits. Two single hex digits are special: the first digit of the third group is the version, and the first digit of the fourth group is the variant.
The Main UUID Versions
Version 1 is time-based and historically combined a timestamp with a network node value, which was often the machine MAC address (the RFC also allows a random node). Version 3 and version 5 are name-based, derived by hashing a namespace and a name with MD5 for v3 and SHA-1 for v5. Version 4 is fully random. Version 7, added in RFC 9562, is time-ordered: it places a 48-bit Unix millisecond timestamp first, then random bits, so values sort by creation time. Because v1 could embed the MAC address, the same hardware identifier our MAC Address Tool decodes, v4 and v7 are usually preferred today.
How to Read the Version and Variant
The version is the 13th hex digit, the first digit of the third group: a 4 there means version 4 and a 7 means version 7. The variant is encoded near the 17th hex digit, the first digit of the fourth group, and is typically 8, 9, a, or b for the modern RFC 4122 and RFC 9562 variant. A version 7 timestamp is just the first 48 bits read as milliseconds since the Unix epoch, which you can convert with our Unix Timestamp Converter.
The Nil and Max UUIDs
Two values are reserved rather than generated. The nil UUID is all zeros (00000000-0000-0000-0000-000000000000) and represents an empty or absent identifier. The max UUID, defined in RFC 9562, is all f digits (ffffffff-ffff-ffff-ffff-ffffffffffff) and represents the largest possible value. Both are special markers, not real identifiers a generator hands out.
Frequently Asked Questions
What does the UUID format look like?
A UUID is 128 bits shown as 32 hexadecimal digits grouped as 8-4-4-4-12 and joined by hyphens, giving 36 characters in total. An example shape is xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx. The digit at position M marks the version and the digit at position N marks the variant.
What are the main UUID versions?
Version 1 is time based and historically combined a timestamp with a network node value. Version 3 and version 5 are name based, derived by hashing a namespace and name with MD5 for version 3 and SHA-1 for version 5. Version 4 is random, and version 7 is time ordered using a Unix millisecond timestamp followed by random bits.
How can you tell which version a UUID is?
The version is encoded in a single hexadecimal digit at the 13th position, which is the first digit of the third group. For example a 4 there indicates version 4 and a 7 indicates version 7. The variant is encoded near the 17th position, the first digit of the fourth group, and is typically 8, 9, a, or b for the RFC 4122 variant.
What are the nil UUID and the max UUID?
The nil UUID is all zeros and represents an empty or absent identifier. The max UUID, added in RFC 9562, is all f hexadecimal digits and represents the largest possible value. Both are special reserved values rather than generated identifiers.
Do UUIDs guarantee uniqueness?
UUIDs are designed to be unique across space and time without coordination, and in practice correctly generated values do not collide. The guarantee is probabilistic rather than absolute, since random and time based schemes rely on extremely low collision odds rather than a central registry. Following the RFC generation rules is what keeps collisions astronomically unlikely.