A GUID is a 128-bit value consisting of one group of 8 hexadecimal digits, followed by three groups of 4 hexadecimal digits each, followed by one group of 12 hexadecimal digits.
The following example GUID shows the groupings of hexadecimal digits in a GUID:
While each generated GUID is not guaranteed to be unique, the total number of unique keys (2^128 or 3.4×10^38) is so large that the probability of the same number being generated twice is very very small.
For example, consider the observable universe, which contains about 5×10^22 stars, every star could then have about 6.8×10^15 universally unique GUIDs.
There are 2128 possible GUIDs; that’s almost 40 Billion Billion Billion unique GUIDs for every person on earth.
2^128 is exactly equal to
This is the total number of possible GUIDs in this universe.
A GUID is:
- 1 in 2^128
- 1 in 340 undecillion (see more here NUMBER TABLE)
- 1 in 3.4 × 10^38
- 1 in 340,000,000,000,000,000,000,000,000,000,000,000,000
Assume that we have 230 computers and we put all these computers to the task of generating GUIDs, if each computer can generate, about 220 GUIDs per second.
then after only about 272 seconds — 150 trillion years,
you’ll have a very high chance of generating a duplicate GUID.
With the above maths, it is very unlikely of getting a duplicated GUID, but still, we cannot say that GUID is Guaranteed Unique.
The above information might not be 100% accurate, it is just an estimation.