TechTarget.com/searchapparchitecture

https://www.techtarget.com/searchapparchitecture/definition/UUID-Universal-Unique-Identifier

What is a UUID (Universally Unique Identifier)?

By Scott Robinson

A UUID (Universal Unique Identifier) is a 128-bit value used to uniquely identify an object or entity on the internet. Depending on the specific mechanisms used, a UUID is either guaranteed to be different or is, at least, extremely likely to be different from any other UUID generated until A.D. 3400.

UUIDs can be generated to refer to almost anything imaginable. For example, they can identify databases, system instances, primary keys, Bluetooth profiles or objects with short lifetimes.

UUID is an analogous term to GUID, or Global Unique Identifier. Originally, GUID referred to a variant of UUID used by Microsoft, but the terms became synonymous in the Internet Engineering Task Force (IETF) Request for Comments (RFC) 4122 specification. UUID was standardized by the Open Software Foundation, becoming a part of the Distributed Computing Environment (DCE). Different versions of UUID follow the more recent RFC 9562 specifications.

UUIDs are generated using an algorithm based on a timestamp and other factors, such as the network address. Free tools to generate UUIDs include UUID Tools or the Online UUID Generator.

How does a UUID work?

The UUID relies on a combination of components to ensure uniqueness. UUIDs are constructed in a sequence of digits equal to 128 bits. The ID is in hexadecimal digits, meaning it uses the numbers 0 through 9 and letters A through F. The hexadecimal digits are grouped as 32 hexadecimal characters with four hyphens: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX. The number of characters per hyphen is 8-4-4-4-12. The last section of four, or the N position, indicates the format and encoding in one to three bits. Within this format, UUIDs can be generated independently across systems with no need for coordination or management.

For example, UUIDs based on time have segments divided by hyphens that signify low, mid and mid time and version, which are different timestamps used to identify the UUID. The digits under the last section, the node, denote the Media Access Control (MAC) address.

There are three variants of UUIDs:

UUID vs. GUID

UUID and GUID are two representations of a single concept, differing only slightly in their origins and common usage. The following is a comparison:

UUID and GUID identifiers are identical in structure; both are displayed in hexadecimal and hyphenated. GUID identifiers align with the UUID standard RFC 9562. In most practical scenarios, the two are interchangeable.

UUID versions

The current variant of UUID, variant 1, consists of five different versions. These versions differ in how they are constructed. Types of UUIDs include the following:

An extra version of UUID, and a special case, is the Nil UUID. This UUID contains all zeros for integers.

UUID collisions

A collision occurs when the same UUID is generated more than once and is assigned to different objects. Even though it is possible, the 128-bit value is extremely unlikely to be repeated by any other UUID. The possibility is close enough to zero, for all practical purposes, that it is negligible. Even in version 4 UUIDs, where there are fewer UUID combinations, the chance of a collision is low enough to be ignored.

It's so low, in fact, that it's entertaining to ponder: About 2.71 quintillion (2.71 x 10^18) UUIDv4s would need to be generated before the probability of a collision rose to 50%.

UUID use cases

The UUID identifier has a broad range of common applications in wide usage. These include the following:

Sometimes, using a UUID is not a good idea; for instance, in a system where IDs must be strictly sequential or when indexing overhead might be a problem, as in relational databases.

How to generate a UUID

UUIDs are so ubiquitous that it comes as no surprise that there are many ways to generate them. Doing so is a straightforward process, facilitated by built-in libraries in all the most commonly used programming languages. The following steps are generally the same across languages:

  1. Declare the library that facilitates UUID creation; this could be an import statement or equivalent.
  2. Invoke the library code that generates the UUID.
  3. Declare a variable in the program to store the generated UUID; for example, this could be uuid or uuidv4.

The library references are as follows:

Apple devices also have a unique device identifier known as the UDID, which is mainly used to associate a device with a specific Apple account. Learn how a UDID works and the benefits it provides Apple devices.

18 Aug 2025

All Rights Reserved, Copyright 2019 - 2026, TechTarget | Read our Privacy Statement