What a version 4 UUID contains
A UUID is a 128-bit value written as 32 hex digits in five groups: 8-4-4-4-12. In version 4, six of those bits are fixed - the 13th digit is always 4 (the version) and the 17th is 8, 9, a or b (the variant). The remaining 122 bits are random, which is roughly 5.3 undecillion possibilities, so accidental collisions are not a practical concern.
The random password generator covers the same ground with a different mechanism.
How to use this generator
Choose how many identifiers you need, from 1 to 50, and press Generate for a fresh batch. Values come from crypto.randomUUID() where the browser supports it, and otherwise from crypto.getRandomValues() with the version and variant bits set manually. Generation is local, so no identifier is ever sent to a server. Need a different kind of random-looking string? See the password entropy calculator.
When you need something similar but not identical, the random number generator is there.
Where UUIDs are used
UUIDs are the standard choice for database primary keys that must be created offline, message and request IDs in distributed systems, file and upload names, idempotency keys for payment APIs, and device or session identifiers. Because they are generated independently, two services can create rows for the same table without coordinating or waiting on a shared counter.
The trade-off is storage and index performance: a UUID takes 16 bytes against 4 or 8 for an integer, and random values scatter writes across an index. If insert throughput matters, store them in a native uuid column rather than a 36-character string, or use a time-ordered variant such as UUID v7.
The JSON formatter handles the same job in a slightly different way.
Frequently asked questions
- Are these UUIDs really random?
- Yes. They use the browser's cryptographic random number generator, not Math.random, wherever that API is available.
- Why is the third group always starting with 4?
- That digit encodes the UUID version. A 4 marks a randomly generated UUID under RFC 4122.
- Can two generated UUIDs be the same?
- In theory yes, in practice no. With 122 random bits you would need billions of UUIDs before a collision became remotely likely.
- Are the values sent to a server?
- No. Everything is generated in your browser, so the identifiers exist only on your device until you copy them.
- Can I use a version 4 UUID as a secret or an API token?
- You should not. A version 4 UUID is random but it is designed to be shared and shown in URLs and logs, and it carries 122 bits in a predictable, public format. Use a purpose-built token generator for secrets.