Advertisement
UUID Generator
Generate standard UUIDs (Universally Unique Identifiers) of various versions with a single click. All UUIDs are generated locally in your browser and never stored on any server.
GUID Generator
Generate Microsoft-style GUIDs (Globally Unique Identifiers). GUIDs are 128-bit integers used to identify resources uniquely across Windows platforms and software.
Generation History
Your recently generated UUIDs and GUIDs (stored locally in your browser)
No history yet
Advertisement
UUID & GUID Encyclopedia
What is a UUID?
A Universally Unique Identifier (UUID) is a 128-bit label used for information in computer systems. The term Globally Unique Identifier (GUID) is also used, generally in Microsoft environments. UUIDs are designed to be unique across both space and time, without requiring a central registration authority.
The UUID standard was originally created by Apollo Computer for use in the Network Computing System (NCS) and later adopted by the Open Software Foundation (OSF) as part of the Distributed Computing Environment (DCE). The specification was formalized as RFC 4122, which defines the standard structure and generation algorithms for UUIDs.
A UUID is represented as a 36-character string, consisting of 32 hexadecimal digits separated by four hyphens in the format 8-4-4-4-12. For example: 123e4567-e89b-12d3-a456-426614174000
UUID Versions
There are several versions of UUIDs, each generated using different algorithms and serving different purposes:
Version 1 (Time-based UUID)
Version 1 UUIDs are generated based on the current timestamp and the MAC address of the computer generating the UUID. This ensures uniqueness across devices and time, but includes identifying information that may be privacy-sensitive.
The timestamp is a 60-bit value representing the number of 100-nanosecond intervals since October 15, 1582. The MAC address provides a unique node identifier, making v1 UUIDs traceable to the physical device that created them.
Version 3 (Name-based UUID using MD5)
Version 3 UUIDs are generated by hashing a namespace identifier and a name using the MD5 algorithm. This produces the same UUID for the same namespace and name combination, making them deterministic.
MD5 is a cryptographic hash function that produces a 128-bit hash value. While still functional, v3 UUIDs are less commonly used today due to the security vulnerabilities found in the MD5 algorithm.
Version 4 (Random UUID)
Version 4 UUIDs are generated using random or pseudo-random numbers. This is the most commonly used UUID version due to its simplicity and privacy benefits, as it contains no identifying information about the creator.
In a standard v4 UUID, four bits are used to indicate the version (4) and two bits indicate the variant. This leaves 122 bits for random data, resulting in a total of 2¹²² possible unique UUIDs.
The probability of duplicate v4 UUIDs is extremely low. For practical purposes, it's considered negligible. To have a 50% chance of collision, you would need to generate approximately 2.71 quintillion v4 UUIDs.
Version 5 (Name-based UUID using SHA-1)
Version 5 UUIDs are similar to v3, but use the SHA-1 hashing algorithm instead of MD5. SHA-1 is more secure than MD5, making v5 the preferred choice for deterministic UUID generation.
Like v3, v5 UUIDs are deterministic - the same namespace and name will always produce the same UUID. This makes them ideal for situations where you need to consistently generate the same identifier for a given resource.
What is a GUID?
GUID stands for Globally Unique Identifier. It is essentially the same as a UUID, but the term is primarily used in Microsoft technologies and environments. GUIDs follow the same 128-bit structure as UUIDs and are interoperable with UUID systems.
Microsoft implemented GUIDs as part of their COM (Component Object Model) technology, where they are used to uniquely identify interfaces, classes, and other software components. GUIDs are also extensively used in the Windows Registry, Active Directory, and various Microsoft development platforms.
While technically equivalent to UUIDs, GUIDs may be represented differently in Microsoft systems. They can be displayed with or without curly braces, and in some cases as pure hexadecimal values without hyphen separators.
UUID vs GUID: What's the Difference?
From a technical perspective, UUIDs and GUIDs are essentially the same. Both are 128-bit unique identifiers following the same standard structure. The primary difference is terminology and usage context:
- UUID is the standard term defined by RFC 4122 and used across most non-Microsoft platforms
- GUID is the Microsoft implementation and terminology for the same identifier standard
- All GUIDs are UUIDs, but not all UUIDs are necessarily referred to as GUIDs
- Both provide the same level of uniqueness and follow the same 128-bit format
The confusion between UUID and GUID primarily stems from historical naming conventions. Microsoft adopted the term GUID before the UUID standard was fully formalized, and has continued to use the GUID terminology for compatibility reasons.
Practical Applications of UUIDs and GUIDs
UUIDs and GUIDs have numerous practical applications across computer science and software development:
Database Primary Keys
UUIDs are commonly used as primary keys in distributed databases, where multiple systems need to generate unique identifiers without coordination. This eliminates the need for central ID generation and simplifies database merging and replication.
Software Component Identification
GUIDs are extensively used in Microsoft technologies to uniquely identify software components, interfaces, and classes. This allows systems to correctly reference and load the appropriate software modules.
Session Identification
Web applications and mobile apps use UUIDs to generate unique session identifiers for users. These random identifiers are difficult to guess, enhancing security and preventing session hijacking.
File and Resource Identification
UUIDs uniquely identify files, documents, and resources across systems and networks. This is particularly useful in distributed file systems and cloud storage solutions.
Messaging and Event Systems
UUIDs identify individual messages and events in message queues and event-driven architectures, ensuring proper tracking and processing of asynchronous communications.
UUID Structure and Format
A UUID is a 128-bit value represented as a hexadecimal string formatted in five groups separated by hyphens: 8-4-4-4-12 characters.
The formal definition from RFC 4122 specifies the following structure:
UUID = time-low "-" time-mid "-" time-high-and-version "-" clock-seq-and-reserved clock-seq-low "-" node
Where:
- time-low (32 bits): The low field of the timestamp
- time-mid (16 bits): The middle field of the timestamp
- time-high-and-version (16 bits): The high field of the timestamp multiplexed with the version number
- clock-seq-and-reserved (8 bits): The high field of the clock sequence multiplexed with the variant
- clock-seq-low (8 bits): The low field of the clock sequence
- node (48 bits): The spatially unique node identifier
The version number is encoded in the most significant bits of the time-high-and-version field, making it easy to identify which UUID version is being used.
Uniqueness and Collision Probability
One of the most important aspects of UUIDs is their uniqueness. The design of UUIDs ensures that the same identifier is extremely unlikely to be generated twice.
For Version 4 UUIDs, which use random numbers, the probability of collision is extraordinarily low. With 122 bits of randomness, there are 5.3 x 10³⁶ possible unique Version 4 UUIDs.
To put this in perspective: you would need to generate 1 billion UUIDs per second for approximately 85 years to have a 50% chance of a single duplicate. For most practical applications, this probability is considered zero.
The uniqueness of UUIDs doesn't depend on a central authority or coordination between systems. This makes them ideal for distributed systems where multiple independent components need to generate identifiers without communication.
Advantages of Using UUIDs
- Decentralized Generation: UUIDs can be generated anywhere without coordination, making them perfect for distributed systems
- Uniqueness: The probability of duplicates is negligible for most applications
- Interoperability: UUIDs are standardized and work across all platforms, programming languages, and systems
- Privacy Options: Version 4 UUIDs contain no identifying information about the creator
- Deterministic Options: Versions 3 and 5 allow generating the same UUID for the same input consistently
- Offline Capability: Can be generated without network access or database connections
- Simplified Data Integration: Makes merging databases easier as identifiers are unique across systems
Disadvantages and Considerations
- Size: UUIDs are 16 bytes (128 bits), larger than 4-byte integers or 8-byte big integers
- Readability: UUIDs are not human-friendly and difficult to remember or communicate
- Indexing Performance: In databases, indexing UUIDs can be less efficient than sequential integers
- Version 1 Privacy Concerns: Contains MAC address information, which may be privacy-sensitive
- Fragmentation: Random UUIDs can cause database index fragmentation
Despite these considerations, the benefits of UUIDs usually outweigh the drawbacks in distributed systems and applications requiring unique identifiers across multiple uncoordinated systems.
Frequently Asked Questions
What is the difference between UUID v1 and v4?
UUID v1 is generated using your computer's MAC address and current timestamp, making it traceable but guaranteed unique across devices. UUID v4 is generated using purely random numbers, providing better privacy as it contains no identifying information. Version 4 is the most commonly used UUID type for most general purposes.
Are UUIDs really unique?
Yes, UUIDs are practically unique for all intents and purposes. The probability of generating duplicate UUIDs is extremely low - especially for version 4. With 122 bits of randomness, you would need to generate billions of UUIDs per second for centuries to have a significant chance of collision. This level of uniqueness is sufficient for virtually all computing applications.
What is the difference between UUID and GUID?
Technically, UUID (Universally Unique Identifier) and GUID (Globally Unique Identifier) are the same. Both are 128-bit unique identifiers following the same standard. The difference is primarily terminology: UUID is the standard term used in most computing environments, while GUID is the Microsoft-specific implementation and terminology. All GUIDs are UUIDs, and they are completely interoperable.
Are my generated UUIDs stored anywhere?
No. All UUIDs and GUIDs generated on this website are created locally in your browser. They are never transmitted to any server, ensuring complete privacy. Your generation history is stored only in your browser's local storage and never leaves your device.
When should I use UUIDs in my database?
UUIDs are ideal for distributed systems, databases that need to be merged, applications operating offline, or any scenario where multiple systems generate records independently without coordination. They prevent ID collisions that would occur with auto-incrementing integers when merging data from different sources. UUIDs also enhance security by not revealing information about record count or creation order.
How long do UUIDs last? Do they expire?
UUIDs themselves do not have an expiration date. Once generated, they are permanent identifiers. The uniqueness guarantee is effectively permanent as well. The only time-limited aspect is that version 1 UUIDs include a timestamp, but the identifier itself remains valid indefinitely.
Can I determine when or where a UUID was generated?
Only for version 1 UUIDs, which contain timestamp and MAC address information that can be decoded to determine the approximate time and physical device that created it. Version 4 UUIDs contain no such information - they are purely random and reveal nothing about their creation time or location.
What are the different GUID formats?
GUIDs can be represented in several formats: Normal format (hyphen-separated hex digits), Braced format (normal format enclosed in curly braces), and Hexadecimal format (32 hex digits without separators). All formats represent the same 128-bit value and are interchangeable. The format is just a matter of representation for different systems.
Is there any performance impact to using UUIDs?
UUIDs are larger (16 bytes) than integer IDs (4-8 bytes), which means they take more storage space and can be slightly less efficient for database indexing. However, modern database systems handle UUIDs efficiently, and the benefits of decentralized ID generation usually outweigh the minor performance considerations in most applications.
Can I generate the same UUID twice intentionally?
Yes, by using UUID version 3 or 5. These versions generate deterministic UUIDs based on a namespace and name combination. The same input will always produce the same UUID. Version 5 uses SHA-1 hashing and is recommended over version 3 which uses the less secure MD5 algorithm. Versions 1 and 4 are not deterministic and should not be used if you need reproducible results.