UUID generator
Unique identifiers v4 (random) and v7 (sortable) for your projects.
Frequently asked questions
What is the difference between UUID v4 and v7?
v4 is fully random: 122 bits of entropy, no temporal order. v7 prefixes a 48-bit timestamp: equally unique in practice, but chronologically sortable — ideal for database primary keys because it improves insertion locality and B-tree index efficiency.
Which one should I use for my database?
If your DB supports v7 (Postgres ≥17 has it natively, earlier versions via extensions), use it: much better insert performance than v4 on large tables. Otherwise v4 is still perfectly valid for context-free unique identifiers.
Is it safe to generate UUIDs in the browser?
Yes. crypto.getRandomValues() is cryptographically secure and more than enough for unique UUIDs. The collision probability for v4 is astronomically low: you would need to generate trillions of trillions of them to expect a single collision.
