What is uuid
Last updated: April 1, 2026
Key Facts
- Consists of 128 bits divided into five groups displayed in hexadecimal format (8-4-4-4-12), creating a string like 550e8400-e29b-41d4-a716-446655440000
- Multiple UUID versions (v1 through v5) use different generation methods: v1 uses timestamps and MAC addresses, v4 uses random numbers, and v5 uses SHA-1 hashing
- The probability of generating duplicate UUIDs is astronomically low, making them suitable for globally unique identification without central coordination
- Widely adopted in databases (as primary keys), APIs, distributed systems, cloud computing, and software frameworks as a standard identifier
- Also known as GUID (Globally Unique Identifier) in Microsoft systems, though GUID technically refers to a specific implementation of UUID format
Overview
A UUID (Universally Unique Identifier), also known as a GUID in some contexts, is a standardized 128-bit identifier designed to uniquely identify objects, entities, or information across distributed computer systems without requiring a central registry or coordination. The UUID standard was formalized by the Internet Engineering Task Force (IETF) and is specified in RFC 4122. Unlike sequential numbering systems that require central management, UUIDs are designed to be globally unique with virtually no collision risk, making them ideal for decentralized systems, databases, and distributed applications where coordination is impractical or impossible.
UUID Structure and Format
A UUID is represented as a 32-character hexadecimal string divided into five groups: 8-4-4-4-12 format. Each group represents different segments of the 128-bit identifier:
- Time low: 8 hexadecimal digits representing the first 32 bits
- Time mid: 4 hexadecimal digits representing the next 16 bits
- Time high and version: 4 hexadecimal digits indicating the UUID version and timestamp
- Clock sequence: 4 hexadecimal digits for uniqueness in distributed generation
- Node identifier: 12 hexadecimal digits, typically derived from hardware addresses or random values
An example UUID appears as: 550e8400-e29b-41d4-a716-446655440000. The hyphens are included for readability but are optional in some applications.
UUID Versions and Generation Methods
UUID v1 (Time-based): Uses timestamps and MAC addresses, ensuring uniqueness based on when and where generated. Requires hardware identification.
UUID v3 (MD5-based): Uses MD5 hashing of a namespace and name, producing the same UUID for identical inputs.
UUID v4 (Random): Generated entirely from random numbers, most commonly used in modern systems. No central coordination needed.
UUID v5 (SHA-1-based): Uses SHA-1 hashing, similar to v3 but with stronger hashing. Produces deterministic results for identical inputs.
UUID v4 is the most popular version for new applications due to its simplicity and lack of privacy concerns associated with hardware identifiers in v1.
Applications and Use Cases
UUIDs are essential in numerous computing contexts:
- Database systems: Primary keys in distributed databases where auto-incrementing IDs are impractical
- APIs and web services: Unique identifiers for resources that remain consistent across systems
- Distributed systems: Enabling decentralized generation without coordination bottlenecks
- Cloud computing: Identifying resources across multiple servers and geographic regions
- Software applications: Session IDs, request identifiers, and entity tracking
- Message queuing: Ensuring unique message identification in asynchronous systems
Advantages and Considerations
UUIDs eliminate the need for central ID assignment authorities, crucial for distributed and microservices architectures. Their 128-bit length provides virtually zero collision probability across all practical applications. However, UUIDs consume more storage space than sequential integer IDs and are less human-readable. Some developers prefer shorter identifiers for specific use cases, though UUIDs remain the standard for globally distributed systems. Modern databases and frameworks provide native UUID support, making implementation straightforward.
Related Questions
How are UUIDs generated?
UUID generation varies by version. UUID v4 (most common) uses cryptographic random number generation. UUID v1 uses timestamps combined with MAC addresses. UUID v5 uses SHA-1 hashing of namespaces and names. Each method ensures extremely low collision probability.
What is the difference between UUID and GUID?
UUID is the international standard specification (RFC 4122) for universally unique identifiers, while GUID is Microsoft's implementation of the UUID standard. GUIDs follow the UUID format but are specific to Microsoft technologies. The terms are often used interchangeably.
Why are UUIDs used in databases?
UUIDs enable distributed database systems to generate unique primary keys without central coordination. Unlike auto-increment IDs that require database communication, UUIDs can be generated locally, essential for microservices and database replication scenarios.
More What Is in Daily Life
Also in Daily Life
More "What Is" Questions
Trending on WhatAnswers
Browse by Topic
Browse by Question Type
Sources
- Wikipedia - Universally Unique IdentifierCC-BY-SA-3.0
- IETF RFC 4122 - Universally Unique IdentifierPublic Domain