Developer
What Is a UUID?
5 min read
A UUID (Universally Unique Identifier) is a 128-bit label used to uniquely identify objects in computer systems. They look like this: 550e8400-e29b-41d4-a716-446655440000
UUID Versions
- UUID v1: Based on time and MAC address. Not recommended for new projects due to privacy concerns.
- UUID v4: Randomly generated. The most common choice — 122 bits of randomness makes collisions virtually impossible.
- UUID v5: Name-based, using SHA-1 hashing. Deterministic — same input always produces the same UUID.
When to Use UUIDs
- As primary keys in databases (especially distributed systems)
- Session tokens and request IDs
- File naming to avoid conflicts
- Any situation where you need a globally unique identifier without a central authority
UUIDs vs Auto-Increment IDs
Auto-increment IDs (1, 2, 3...) are simple but reveal information about your data (e.g., number of users). They also cause issues in distributed systems where multiple nodes generate IDs. UUIDs solve both problems.
Generate v4 UUIDs instantly with our UUID Generator.