What Is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit number used to uniquely identify resources in computer systems. The standard format looks like this:
550e8400-e29b-41d4-a716-446655440000
UUIDs are designed to be unique across all systems without requiring a central authority. The probability of generating two identical UUIDs is practically zero.
UUID Versions Explained
UUID v1 (Time-based)
Generated using the current timestamp and the machine's MAC address. Guarantees uniqueness but reveals when and where it was created.
UUID v4 (Random)
Generated using random numbers. Most commonly used version. No information leakage, but there's an astronomically small chance of collision.
UUID v5 (Name-based)
Generated by hashing a namespace and name using SHA-1. The same input always produces the same UUID, making it deterministic and reproducible.
When to Use UUIDs
- Database primary keys — especially in distributed systems
- API resource identifiers — prevents enumeration attacks
- Session tokens — unique session identification
- File naming — avoid collisions in upload systems
- Correlation IDs — track requests across microservices
UUID vs Auto-Increment IDs
| Feature | UUID | Auto-Increment |
| Uniqueness | Global | Per table |
| Distributed | Yes | Requires coordination |
| Predictable | No | Yes (security risk) |
| Size | 16 bytes | 4-8 bytes |
| Performance | Slower indexing | Faster indexing |
Generate UUIDs Online
Best Practices
- Use UUID v4 for most cases — it's simple and secure
- Use UUID v5 when you need deterministic IDs
- Store UUIDs as binary (16 bytes) in databases for better performance
- Consider ordered UUIDs (UUID v7) for database primary keys to maintain index performance
Free UUID Generator
Our UUID Generator creates UUIDs instantly in your browser. Generate single or bulk UUIDs for your development projects.