Back to Blog
Development

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.

2025-01-136 min

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.

Best Practices

  • For databases: Use UUID v7 or ULID for sortable IDs
  • For APIs: UUID v4 is simple and widely supported
  • For deterministic IDs: Use UUID v5 with a namespace
  • For distributed systems: Consider Snowflake IDs
  • Our UUID Generator Features

  • Generate all UUID versions (v1-v7)
  • Bulk generation (up to 100 at once)
  • ULID, NanoID, and CUID2 support
  • Customizable format options
  • One-click copy functionality