What a UUID is
A UUID is a 128-bit identifier written as 32 hexadecimal digits in five hyphen-separated groups. Version 4 is the fully random variant: six bits are fixed to record the version and variant, and the remaining 122 are random.
The point of that much randomness is that you can generate an identifier anywhere — on a phone that is currently offline, on any one of a hundred servers — without asking a central authority whether it is taken. With 122 random bits you would need to generate roughly a billion UUIDs per second for about 85 years before a collision became likely.
Randomness matters
That guarantee depends entirely on the randomness being real. A UUID built from Math.random() looks identical but is generated by a predictable algorithm — given a few outputs, the rest can be derived. This tool uses crypto.randomUUID(), backed by the operating system's entropy source. That distinction matters any time a UUID doubles as something unguessable, such as an invitation link or a password reset token.
For passwords rather than identifiers, use the secure password generator. For a deterministic fingerprint of some content, use the hash generator.