UUID Generator
Generate universally unique identifiers (UUIDs) — choose between v1 (timestamp-based) and v4 (random) with bulk generation support.
How to Use the UUID Generator
Create universally unique identifiers for databases, APIs, and distributed systems.
- Choose UUID version: v4 for completely random UUIDs, or v1 for timestamp-based UUIDs.
- Set quantity from 1 to 1000 UUIDs for bulk generation.
- Select format with or without hyphens, and choose uppercase or lowercase.
- Click Generate to create your UUIDs instantly.
- Copy or download the results for use in your applications.
What is a UUID?
A Universally Unique Identifier (UUID) is a 128-bit number used to uniquely identify information in computer systems. UUIDs are standardized by the Open Software Foundation (OSF) as part of the Distributed Computing Environment (DCE).
The probability of generating duplicate UUIDs is so low that it's considered negligible for practical purposes. This makes UUIDs ideal for distributed systems where centralized ID generation isn't feasible.
UUIDs are typically represented as 32 hexadecimal digits displayed in five groups separated by hyphens: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (8-4-4-4-12 format).
UUID Version Comparison
| Version | Generation Method | Use Case | Uniqueness |
|---|---|---|---|
| UUID v1 | Timestamp + MAC address | When temporal ordering matters; database primary keys | Guaranteed unique per system |
| UUID v4 | Random generation | General purpose; maximum privacy; stateless systems | Statistically unique (collision extremely unlikely) |
UUID v1 includes a timestamp and MAC address (or random node ID). This provides temporal ordering but may expose system information. UUIDs generated at the same moment on the same machine will be sequential.
UUID v4 is completely random (except for version and variant bits). This provides better privacy and is suitable when ordering doesn't matter. The collision probability is about 1 in 2^122.
UUID Format Examples
| Format | Example | Length |
|---|---|---|
| Standard (with hyphens) | 550e8400-e29b-41d4-a716-446655440000 | 36 characters |
| No hyphens (hex string) | 550e8400e29b41d4a716446655440000 | 32 characters |
| URN format | urn:uuid:550e8400-e29b-41d4-a716-446655440000 | 45 characters |
| GUID (Microsoft) | {550e8400-e29b-41d4-a716-446655440000} | 38 characters |
Common Use Cases
Database Primary Keys: UUIDs make excellent primary keys for distributed databases where auto-increment IDs aren't practical. No coordination needed between database nodes.
API Request IDs: Track requests across microservices and distributed systems. Each request gets a unique ID for logging and tracing.
Session Identifiers: Generate unpredictable session IDs for web applications and authentication systems.
File Naming: Create unique filenames for uploaded files to avoid conflicts and prevent directory traversal attacks.
Object Storage: Identify objects in cloud storage systems (S3, Azure Blob) where globally unique names are required.
Message Queues: Uniquely identify messages in distributed queue systems like RabbitMQ, Kafka, or SQS.
UUID Best Practices
Choose the right version: Use v4 for general purposes and when privacy matters. Use v1 when you need temporal ordering or sortable IDs.
Store efficiently: In databases, store UUIDs as binary (16 bytes) rather than strings (36 bytes) for better performance and space usage.
Index considerations: UUID v4 primary keys can cause index fragmentation due to randomness. Consider UUID v1 or ULID for better B-tree performance.
Don't rely on secrecy: UUIDs are identifiers, not secrets. Don't use them alone for authentication or authorization.
Frequently Asked Questions
uuid.uuid4() in Python, UUID.randomUUID() in Java, Guid.NewGuid() in C#, crypto.randomUUID() in Node.js 16+.