UUID Generator: Understanding Different UUID Versions
Learn about UUID versions 1-7, when to use each type, and best practices for generating unique identifiers in your applications.
What is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit label used to identify information in computer systems. UUIDs are designed to be unique without requiring a central authority.
UUID Versions Explained
UUID v1 (Time-based)
Uses the current timestamp and MAC address. Good for time-ordered IDs but may expose device information.
UUID v3 (Name-based, MD5)
Generated by hashing a namespace and name with MD5. Same inputs always produce the same UUID.
UUID v4 (Random)
Generated from random numbers. The most commonly used version due to simplicity and good uniqueness guarantees.
UUID v5 (Name-based, SHA-1)
Similar to v3 but uses SHA-1 for hashing. More secure than v3.
UUID v6 (Reordered Time-based)
Like v1 but reordered for better database indexing. The timestamp bits are arranged for lexicographic sorting.
UUID v7 (Unix Timestamp)
Uses Unix timestamp in milliseconds. Excellent for database primary keys as they're naturally sortable.