UUID Guide for Developers
Complete guide to UUID versions, use cases, and best practices in software development.
Generate v1, v3, v4, v5, v6, v7 UUIDs · Bulk export · Validate · Inspect · Batch check
Click "Generate UUID" or press Ctrl+Enter
UUID stands for Universally Unique Identifier — a 128-bit label standardised in RFC 4122 (updated as RFC 9562). It is represented as 32 hexadecimal characters in 5 groups separated by hyphens: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. UUIDs are designed to be unique without requiring a central coordinator, making them ideal for distributed systems, databases, and APIs.
For most applications, use v4 (random) — it is the simplest and most common choice with excellent uniqueness guarantees. Use v7 for database primary keys as it is time-ordered and indexes efficiently. Use v1 or v6 when you need to recover the generation time from the UUID itself. Use v3 or v5 when you need deterministic UUIDs from the same namespace + name input — useful for consistent resource identifiers.
UUID v4 is entirely random with no embedded information — it is the safest choice when you do not need ordering. UUID v7 embeds the current Unix millisecond timestamp in the first 48 bits, making it lexicographically sortable. This makes v7 far more efficient for database primary keys because it generates index-friendly sequences — new UUIDs always sort after existing ones, reducing B-tree fragmentation by up to 90%.
Theoretically yes, but practically the probability is negligible. UUID v4 has 2¹²² ≈ 5.3 × 10³⁶ possible values. To have a 50% chance of a collision, you would need to generate approximately 2.7 × 10¹⁸ UUIDs — far beyond any real-world system. The collision probability panel in this tool shows the exact mathematical probability using the Birthday Problem formula.
Namespace UUIDs (v3 and v5) are deterministic — the same namespace + name input always produces the same UUID output. v3 uses MD5 hashing and v5 uses SHA-1. Standard namespaces include DNS (for domain names), URL, OID, and X.500 DNs. They are useful when you want the same resource (e.g., a URL or email address) to always map to the same UUID, enabling idempotent systems.
GUID (Globally Unique Identifier) is Microsoft's implementation of UUID, used in Windows COM and .NET. They are functionally the same 128-bit standard but GUIDs are often displayed in uppercase with curly braces: {550E8400-E29B-41D4-A716-446655440000}. This UUID generator supports both formats — use the Braces format option for GUID-style output.
Complete guide to UUID versions, use cases, and best practices in software development.
Choosing the right primary key strategy: UUID vs auto-increment vs composite keys.
ID generation strategies for distributed systems and microservices architecture.