UUID Generator
Generate cryptographically random UUID v4 identifiers. Everything runs locally in your browser.
UUIDs (Universally Unique Identifiers) are 128-bit identifiers designed to be unique across time and space without a central coordination authority. UUID v4, the most commonly used variant, uses random numbers to generate identifiers with a collision probability so low it is effectively zero for any practical application.
A UUID v4 has 122 bits of randomness (6 bits are fixed for version/variant encoding). The probability of generating a duplicate UUID among 1 trillion UUIDs is approximately 1 in 10^18. For all practical purposes, you will never see a collision.
UUID structure
A UUID is 128 bits displayed as 32 hexadecimal digits separated by hyphens in 5 groups: 8-4-4-4-12. For UUID v4: the 13th character is always "4" (version identifier) and the 17th character is "8", "9", "a", or "b" (variant indicator). Example: 550e8400-e29b-41d4-a716-446655440000. The rest of the characters are randomly generated using a cryptographically secure random source.
Common uses
Database primary keys (avoiding sequential integer IDs that leak information about record counts), API request IDs for tracing and debugging, file names for uploaded assets, session tokens, idempotency keys for payment processing, and any context where a globally unique identifier is needed without coordination between systems. UUIDs are particularly useful in distributed systems where multiple services generate records independently.
UUID versions
UUID v1 uses the machine's MAC address and timestamp (deterministic, potentially identifying). UUID v3 and v5 use MD5 and SHA-1 hashing of a namespace + name (deterministic, not random). UUID v4 uses random numbers (non-deterministic, no identifying information). UUID v7 (newer standard) uses timestamp + random bits for sortable UUIDs. v4 is the most common choice for general-purpose unique identifiers.
Frequently asked questions
Is UUID v4 truly unique?
Practically, yes. The theoretical probability of collision exists but is so small that it is irrelevant for any real-world application. If you generated 1 UUID per second for the entire life of the universe, you would have generated roughly 4 x 10^17 UUIDs, and the probability of even one collision in that set would be about 1 in 10^5. For software applications, treat UUID v4 as unique.
Should I use UUID or auto-increment integer for database IDs?
Auto-increment integers are simpler, smaller (4-8 bytes vs 16 bytes), and index better in most databases. UUIDs are better when: you need to merge records from multiple databases, you want to generate IDs before inserting to the database, you do not want to expose record counts to users, or you are building a distributed system where multiple nodes generate IDs independently.