Dev Tools/UUID Generator
UUID Generator
Generate universally unique identifiers (UUIDs)
Options
UUID Generator Guide
Learn how to generate and use UUIDs effectively
What is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit identifier that is unique across space and time. UUIDs are commonly used as database primary keys, session identifiers, and distributed system identifiers.
How to Use This Tool
- Select the UUID version (v1, v4, or v5)
- Choose your preferred output format
- Set the quantity of UUIDs to generate
- Click Generate to create your UUIDs
Pro Tips
- Use v4 for most cases - it provides excellent randomness
- Use v5 when you need deterministic UUIDs based on names
- The no-dashes format is useful for URLs and filenames
UUID Versions Explained
Version 1 uses timestamp and MAC address, ensuring uniqueness but revealing generation time. Version 4 uses random numbers, ideal for most applications. Version 5 generates deterministic UUIDs from namespace and name using SHA-1.
Frequently Asked Questions
What is the difference between UUID v4 and v5?
UUID v4 generates completely random identifiers, while v5 creates deterministic UUIDs based on a namespace and name. If you hash the same name with the same namespace, you'll always get the same UUID.
Which UUID version should I use?
For most applications, use v4 (random). Use v5 when you need the same input to always produce the same UUID. Use v1 only when you need timestamp-based ordering, but be aware it can reveal generation time.
Are UUIDs truly unique?
UUID v4 has such a large space (2^122 random bits) that collisions are practically impossible. The probability of collision is so low that you'd need to generate 1 billion UUIDs per second for 86 years to have a 50% chance of collision.
Can I use UUIDs as database primary keys?
Yes, UUIDs are commonly used as primary keys. They're especially useful in distributed systems where you can't rely on auto-incrementing integers. However, consider using UUIDs v7 (time-ordered) for better index performance if your database supports it.