UUID Generator Tools
What is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit identifier designed to be unique across all systems, devices, and time without requiring a central registration authority. The concept was originally created for the Apollo Network Computing System and was later standardized by the International Organization for Standardization (ISO) and the Internet Engineering Task Force (IETF).
UUIDs are also commonly known as GUIDs (Globally Unique Identifiers) in Microsoft ecosystems. While technically the same, the term GUID is predominantly used in Windows development, .NET applications, and Microsoft SQL Server, whereas UUID is the standard term used in most other programming languages and databases. Our GUID generator produces the same output but formatted for Microsoft conventions.
Standard UUID Format
A UUID is represented as a 36-character string consisting of 32 hexadecimal digits displayed in five groups separated by hyphens:
xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx
Where:
- x represents a hexadecimal digit (0-9, a-f)
- M indicates the UUID version (1-7)
- N indicates the variant (typically 8, 9, a, or b for RFC 4122 compliant UUIDs)
Example of a valid UUID v4:
550e8400-e29b-41d4-a716-446655440000
Understanding UUID Structure
A UUID consists of 128 bits (16 bytes) of data. When represented as a string, it breaks down into five distinct sections, each serving a specific purpose depending on the UUID version:
| Field Name | Length | Bytes | Description |
|---|---|---|---|
| time_low | 8 hex digits | 0-3 | Low 32 bits of the timestamp (or random in v4) |
| time_mid | 4 hex digits | 4-5 | Middle 16 bits of the timestamp |
| time_hi_and_version | 4 hex digits | 6-7 | High 12 bits of timestamp + 4-bit version number |
| clock_seq_hi_and_res | 2 hex digits | 8 | Clock sequence high + variant bits |
| clock_seq_low | 2 hex digits | 9 | Clock sequence low |
| node | 12 hex digits | 10-15 | 48-bit node identifier (MAC address in v1, random in v4) |
How to Identify UUID Version
You can identify a UUID's version by looking at the 13th character (the first digit of the third group). For example:
550e8400-e29b-11d4-a716-446655440000— Version 1 (timestamp)550e8400-e29b-41d4-a716-446655440000— Version 4 (random)550e8400-e29b-71d4-a716-446655440000— Version 7 (Unix timestamp)
Use our UUID Decoder tool to automatically parse and analyze any UUID, extracting its version, variant, and embedded timestamp information.
UUID Versions Explained
There are several UUID versions defined by RFC 4122 and the newer RFC 9562. Each version has different characteristics and use cases. Our online UUID generator supports the most commonly used versions.
UUID Version 1 — Timestamp + MAC Address
Version 1 UUIDs are generated using a combination of the current timestamp (measured in 100-nanosecond intervals since October 15, 1582, the date of Gregorian calendar reform) and the MAC address of the generating computer.
The timestamp component makes v1 UUIDs naturally sortable by creation time when generated on the same machine. However, the MAC address component means that v1 UUIDs can potentially be traced back to the computer that generated them, which may be a privacy concern in some applications.
Best for: Database records where time-ordering is important and privacy is not a concern.
Generate UUID v1UUID Version 4 — Random (Most Popular)
Version 4 UUIDs are generated using random or pseudo-random numbers. Of the 128 bits, 122 bits are randomly generated while 6 bits are fixed (4 for version, 2 for variant). This is the most commonly used UUID version due to its simplicity, privacy, and excellent collision resistance.
Our UUID generator uses the Web Crypto API to generate cryptographically secure random numbers, ensuring the highest quality random UUIDs. V4 UUIDs don't expose any information about the generating system or the time of generation.
Best for: General purpose unique identifiers, session tokens, API keys, and any use case where privacy and unpredictability are important.
Generate UUID v4UUID Version 5 — SHA-1 Name-Based Hash
Version 5 UUIDs are generated by hashing a namespace identifier together with a name using the SHA-1 algorithm. Given the same namespace and name, v5 will always produce the same UUID, making it deterministic and reproducible.
UUID v5 is preferred over UUID v3 (which uses MD5) due to SHA-1 being a stronger hash function. Common namespaces include DNS, URL, OID, and X.500, each defined with their own namespace UUID.
Best for: Creating consistent UUIDs for resources that can be identified by a name within a namespace, such as URLs or domain names.
Generate UUID v5UUID Version 7 — Unix Timestamp + Random (Newest Standard)
Version 7 is the newest UUID format, defined in RFC 9562 (2024). It combines a Unix timestamp in milliseconds with random data, providing the time-ordering benefits of v1 without exposing hardware information like MAC addresses.
UUID v7 is becoming the recommended choice for new applications that need time-sortable unique identifiers, especially for database primary keys. The time-ordered nature means that new records cluster together on disk, improving database index performance significantly compared to random v4 UUIDs.
Best for: Database primary keys, distributed systems requiring time-ordered IDs, and any scenario where both uniqueness and temporal sorting are needed.
Generate UUID v7Other UUID Versions
Version 2 — DCE Security
Similar to v1 but includes POSIX UID/GID for distributed computing environments. Rarely used in modern applications due to limited utility and security concerns.
Version 3 — MD5 Hash
Name-based UUID using MD5 hashing. Deprecated in favor of v5 due to MD5's known vulnerabilities. Still supported for backward compatibility.
Version 6 — Reordered Timestamp
A reordered version of v1 with improved sorting characteristics. Less commonly used than v7, which is the preferred time-based choice.
Version 8 — Custom
Reserved for custom implementations where organizations can define their own UUID generation scheme while maintaining format compatibility.
Nil UUID: A special UUID where all 128 bits are set to zero: 00000000-0000-0000-0000-000000000000. Used as a placeholder or to indicate "no UUID." Learn more about Nil UUIDs.
How Unique is a UUID? Understanding Collision Probability
One of the most common questions about UUIDs is: "How unique are they really?" The answer lies in mathematics and probability theory. UUIDs are designed to be practically unique without coordination between generating parties.
The Mathematics of UUID Uniqueness
For UUID v4 (random), which uses 122 random bits (the remaining 6 bits are used for version and variant), the total number of possible UUIDs is:
Total possible UUID v4 combinations:
2122 ≈ 5.32 × 1036
That's approximately 5.32 undecillion (5,320,000,000,000,000,000,000,000,000,000,000,000) possible UUIDs
Birthday Paradox and Collision Probability
The probability of UUID collision follows the birthday paradox. To have a 50% chance of at least one collision, you would need to generate approximately:
UUIDs needed for 50% collision probability:
2.71 × 1018 UUIDs
That's approximately 2.71 quintillion UUIDs
Real-World Perspective
To put this astronomical number into perspective:
- Time perspective: If you generated 1 billion UUIDs per second continuously, it would take approximately 86 years to have a 50% chance of generating just one duplicate.
- Global scale: If every human on Earth (8 billion people) each generated 600 million UUIDs, there would still only be a 50% probability of one collision occurring somewhere.
- Internet scale: If every web request on the entire internet was assigned a UUID (approximately 5 billion requests per day), it would take over 1 million years to reach 50% collision probability.
- Storage perspective: Storing 2.71 quintillion UUIDs would require approximately 43 exabytes of storage space—more than all the data centers of major tech companies combined.
Collision Probability Table
| UUIDs Generated | Collision Probability | Context |
|---|---|---|
| 1 million (106) | ~0.00000000000000001% | Small application |
| 1 billion (109) | ~0.00000000001% | Large enterprise |
| 1 trillion (1012) | ~0.00001% | Global scale platform |
| 1 quadrillion (1015) | ~0.01% | Beyond any real-world scenario |
| 2.71 × 1018 | 50% | Theoretical threshold |
This makes UUIDs suitable for virtually any application requiring unique identifiers without central coordination. Learn how to generate UUIDs in your preferred programming language: Python, JavaScript, Java, Go, or explore our bulk generator for generating thousands of UUIDs at once.
Common Use Cases for UUIDs
UUIDs have become an essential tool in modern software development. Here are the most common scenarios where UUIDs provide significant benefits:
Database Primary Keys
UUIDs allow records to be created on any node in a distributed database without worrying about ID conflicts. They're especially useful when merging data from multiple sources or in multi-tenant applications.
Related: PostgreSQL UUID, MySQL UUID, UUID v7 (optimized for databases)
Session & Authentication Tokens
UUIDs provide unpredictable session tokens that are impossible to guess, making them more secure than sequential IDs. They prevent session enumeration attacks and protect user privacy.
Recommended: UUID v4 (cryptographically random)
Distributed Systems & Microservices
Microservices can generate IDs independently without querying a central server, reducing latency and eliminating single points of failure. Each service can create unique identifiers without coordination.
Related: Node.js UUID, Go UUID
File & Object Storage
When storing uploaded files or objects in cloud storage (S3, GCS, Azure Blob), UUIDs prevent naming conflicts and hide information about the total number of files from users. They also prevent path traversal attacks.
Use our bulk generator for batch file processing
API Request Tracing
Assign a UUID to each API request to trace it through logs across multiple services. Correlation IDs enable distributed tracing tools like Jaeger, Zipkin, and AWS X-Ray to visualize request flows.
Transaction & Order IDs
Financial and e-commerce systems use UUIDs to uniquely identify transactions across payment processors, banks, and internal systems. They provide audit trails and prevent duplicate processing.
Database integration: SQL Server, Oracle
Mobile App Development
Mobile apps can generate UUIDs offline and sync with servers later. This is crucial for apps that need to work in areas with poor connectivity while ensuring data integrity when back online.
Mobile SDKs: Swift (iOS), Kotlin (Android), Dart/Flutter
Configuration & Feature Flags
UUIDs identify configuration versions, A/B test variants, and feature flags across environments. They enable rollbacks and ensure configuration consistency in CI/CD pipelines.
Automation: Bash, PowerShell
UUID vs Auto-Increment IDs: A Detailed Comparison
Choosing between UUIDs and auto-increment integers for database primary keys is one of the most debated topics in software architecture. Here's a comprehensive comparison to help you make the right choice.
| Aspect | UUID | Auto-Increment |
|---|---|---|
| Uniqueness Scope | Globally unique across all systems | Unique only within the table |
| Generation Location | Can generate anywhere (client, server, any node) | Requires database connection |
| Storage Size | 16 bytes (128 bits) or 36 chars as string | 4-8 bytes (32-64 bits) |
| Index Performance | v4: Random, causes page splits. v7: Sequential, excellent | Optimal (always sequential) |
| Security | Unpredictable, prevents enumeration attacks | Predictable, can be enumerated |
| Distributed Systems | Excellent (no coordination needed) | Requires sequence coordination |
| Data Migration | Easy (no conflicts when merging) | Complex (ID remapping required) |
| Human Readability | Difficult to read/remember | Easy to read and reference |
| URL Exposure | Safe to expose in URLs | Reveals record count/order |
When to Use UUIDs
- Distributed databases — When running multiple database nodes that need to generate IDs independently
- Microservices architecture — When services create records without database access
- Data synchronization — When merging data from multiple sources (mobile offline sync, multi-tenant apps)
- Security-sensitive applications — When IDs should not be guessable (user profiles, documents)
- Public APIs — When IDs are exposed in URLs and shouldn't reveal business information
When to Use Auto-Increment
- Simple applications — Single database, single server, internal tools
- High-volume logging — Where storage efficiency is critical
- Legacy system integration — When existing systems expect integer IDs
- Human-facing references — Order numbers, ticket IDs that users need to reference verbally
💡 Pro Tip: Best of Both Worlds
Consider using UUID v7 for database primary keys. It combines the global uniqueness of UUIDs with time-ordered generation, providing excellent index performance while maintaining all UUID benefits. PostgreSQL and other modern databases handle UUID v7 efficiently.
Why Use Our Online UUID Generator?
Our free UUID generator tool at onlineuuidgenerator.pages.dev is designed with developers in mind, offering a combination of security, speed, and convenience that sets it apart.
100% Client-Side Generation
All UUIDs are generated entirely in your browser using the Web Crypto API. Nothing is ever sent to our servers. Your generated UUIDs remain completely private and secure.
Instant & Unlimited Generation
Generate single UUIDs instantly or thousands at once with our bulk generator. No rate limits, no registration required, no artificial restrictions. Generate as many UUIDs as you need.
Multiple Versions & Formats
Support for UUID v1, v4, v5, and v7. Output in various formats: uppercase, with braces, without hyphens, or quoted. Export as TXT, JSON, or CSV.
Developer Resources
Comprehensive guides for generating UUIDs in 18+ programming languages and 6 major databases. Copy-paste code examples for Python, JavaScript, Java, and more.
Additional Tools
Beyond generation, use our UUID Validator to check if a string is a valid UUID and detect its version. Use the UUID Decoder to extract timestamps and analyze UUID components.
Mobile-Friendly Design
Fully responsive design works perfectly on phones, tablets, and desktops. Generate UUIDs on the go when you're away from your development machine.
🔒 Security Note
Our tool uses crypto.randomUUID() when available, falling back to crypto.getRandomValues() for maximum compatibility. Both methods provide cryptographically secure random numbers suitable for security-sensitive applications.
Generate UUIDs in Your Programming Language
Need to generate UUIDs programmatically? We provide comprehensive guides with code examples for all major programming languages:
Quick Code Examples
Here are quick examples for the most popular languages:
import uuid
# Generate UUID v4 (random)
my_uuid = uuid.uuid4()
print(my_uuid) # e.g., 550e8400-e29b-41d4-a716-446655440000
// Modern browsers (Chrome 92+, Firefox 95+, Safari 15.4+)
const uuid = crypto.randomUUID();
console.log(uuid); // e.g., 550e8400-e29b-41d4-a716-446655440000
import java.util.UUID;
UUID uuid = UUID.randomUUID();
System.out.println(uuid); // e.g., 550e8400-e29b-41d4-a716-446655440000
UUID in Databases
Using UUIDs as primary keys in databases requires proper configuration for optimal performance. We provide detailed guides for all major database systems:
uuid-ossp extension, gen_random_uuid(), native UUID type, indexing strategies
UUID() function, BINARY(16) storage, UUID_TO_BIN optimization
NEWID(), NEWSEQUENTIALID(), uniqueidentifier type
Application-generated UUIDs, BLOB vs TEXT storage
UUID vs ObjectId, Binary subtype 4, driver support
SYS_GUID(), RAW(16) storage, performance tuning
UUID Standards & Specifications
UUIDs are defined by internationally recognized standards, ensuring interoperability across systems and programming languages:
RFC 4122 — Original UUID Specification (2005)
The foundational specification defining UUID versions 1-5, format, and generation algorithms.
Read RFC 4122 →RFC 9562 — New UUID Formats (2024)
The updated specification introducing UUID versions 6, 7, and 8, with improved time-based sorting and modern use cases.
Read RFC 9562 →ISO/IEC 9834-8:2014
The international standard for UUIDs, ensuring global interoperability and recognition.
View ISO Standard →Wikipedia — Universally Unique Identifier
Comprehensive overview of UUID history, versions, and implementations.
Read on Wikipedia →Frequently Asked Questions
What is the difference between UUID and GUID?
UUID (Universally Unique Identifier) and GUID (Globally Unique Identifier) are essentially the same thing—both refer to a 128-bit unique identifier. The term "GUID" is primarily used in Microsoft ecosystems (Windows, .NET, SQL Server), while "UUID" is the standard term used everywhere else. Our GUID generator produces the same output formatted for Microsoft conventions (uppercase with braces).
Which UUID version should I use?
UUID v4 is the most popular choice for general purposes—it's random, simple, and doesn't expose any system information. UUID v7 is recommended for database primary keys because it's time-sortable, which improves index performance. UUID v1 is useful when you need to extract the creation timestamp later, but it may expose your MAC address.
Are UUIDs truly unique?
While not mathematically impossible, UUID collisions are so improbable that they're considered effectively unique for all practical purposes. With 122 random bits in UUID v4, you would need to generate 2.71 quintillion UUIDs to have a 50% chance of a single collision. For context, if you generated 1 billion UUIDs per second, it would take 86 years to reach that probability.
Can I use UUIDs as database primary keys?
Yes, UUIDs are commonly used as database primary keys, especially in distributed systems. For best performance, use UUID v7 which is time-ordered, reducing index fragmentation. Most modern databases have native UUID types: PostgreSQL, MySQL, and SQL Server all have optimized UUID storage.
Is this UUID generator secure?
Yes, our generator is 100% client-side—all UUIDs are generated in your browser using the Web Crypto API, which provides cryptographically secure random numbers. Nothing is ever sent to our servers. Your generated UUIDs remain completely private.
How do I validate if a string is a valid UUID?
Use our UUID Validator tool to check if a string is a valid UUID. It will verify the format, detect the UUID version, and confirm the variant. You can also validate UUIDs programmatically using regex patterns in any programming language—see our Python or JavaScript guides for examples.
Can I extract the timestamp from a UUID?
Only UUID v1 and UUID v7 contain timestamp information that can be extracted. UUID v4 is completely random and contains no timestamp. Use our UUID Decoder tool to extract and display the embedded timestamp from time-based UUIDs.
What is a Nil UUID?
A Nil UUID (also called empty or zero UUID) is a special UUID where all 128 bits are set to zero: 00000000-0000-0000-0000-000000000000. It's commonly used as a placeholder, to indicate "no UUID assigned," or as a default value in database schemas.