What is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit identifier defined by RFC 4122 that is, for practical purposes, guaranteed to be unique across space and time without a central registration authority. UUIDs are widely used as primary keys in databases, request IDs in distributed systems, and identifiers for resources in REST APIs.
Which version should I use?
- v4 (random) — the most common choice. 122 random bits make collisions astronomically unlikely. Use this unless you have a specific reason not to.
- v1 (timestamp-based) — encodes the creation time and a node identifier. Useful when you need to extract the creation time from the ID itself, though it can leak information about when/where it was generated.
- v7 (sortable) — a newer draft standard that encodes a millisecond timestamp in the most significant bits, so UUIDs generated later sort after ones generated earlier. Ideal for database primary keys where index locality matters.
Is this safe to use for production data?
Yes. This generator runs entirely in your browser using the Web Crypto API (crypto.getRandomValues), the same cryptographically secure random number source used by security-sensitive applications. No UUID you generate here is ever sent to a server.
FAQ
Can two UUIDs ever collide?
In theory yes, in practice no. A v4 UUID has 122 random bits — you would need to generate around 2.71 quintillion UUIDs to have a 50% chance of a single collision.
Are UUIDs case-sensitive?
No. UUIDs are conventionally written in lowercase, but uppercase is equally valid per the spec — use the toggle above if your system expects uppercase.