The Mathematics of UUIDs Why Version 4 UUIDs Will Never Collide — and the Mind-Boggling Scale of 2^122
A UUID v4 has 122 random bits. That is 5.3 × 10^36 possible values. If every person on Earth generated 1 billion UUIDs per second, it would take 10 billion years to have a 50% chance of a single collision. Here's the math.
You generate a UUID v4 with a UUID generator: 550e8400-e29b-41d4-a716-446655440000. The UUID is 36 characters, 32 hex digits, 128 bits total. 122 of those bits are random. That is 2^122 possible values — approximately 5.3 × 10^36. This number is so large that the human brain cannot intuitively grasp it. Here is an attempt: if every person on Earth (8 billion) generated 1 billion UUIDs per second, it would take approximately 10 billion years to have a 50% chance of a single collision. The universe is 13.8 billion years old. A UUID collision is less likely than the universe ending before you finish reading this sentence.
The UUID v4 is designed for one purpose: to be generated independently by different systems without coordination, with a negligible probability of collision. Your web server, your mobile app, and your database replica can all generate UUIDs without talking to each other. The mathematics guarantees they will not collide. The UUID generator produces a UUID v4 in milliseconds. The mathematics guarantees it will be unique. The scale of 2^122 is the guarantee.
Tools mentioned in this article
UUID Generator
Generate random UUID v4 identifiers. Click to copy, generate multiple at once with separator options. Good for database keys, test fixtures, or any time you need a unique ID.
Random Number Generator
Generate random numbers within a range. Set minimum, maximum, and count. Option to allow or exclude repeats. Good for raffles, sampling, and testing.
Hash Generator
Generate SHA-1, SHA-256, SHA-384, and SHA-512 hashes from any text. Also supports MD5 for legacy checks. Compare two hashes side by side to verify file integrity.
