How to Use the UUID Generator
The UUID Generator creates version 4 (random) Universally Unique Identifiers instantly โ individually or in bulk. UUIDs are 128-bit identifiers formatted as 32 hexadecimal digits in the pattern xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx, designed to be globally unique without a central registry.
Click 'Generate' to create a single UUID, or select bulk mode to generate hundreds at once. All UUIDs are generated using cryptographically secure random numbers in your browser. Copy individually or copy all with one click for use in your code, database, or configuration.
A key nuance: UUID v4 relies on randomness. With 122 random bits, the probability of generating two identical UUIDs is astronomically low โ about 1 in 5.3 ร 10ยณโถ. In practice, you'd need to generate approximately 2.7 ร 10ยนโธ UUIDs before having a 50% chance of even one collision. They are safe to use as primary keys without collision checks.
๐ Worked Example
Examples of generated v4 UUIDs:
- 550e8400-e29b-41d4-a716-446655440000
- f47ac10b-58cc-4372-a567-0e02b2c3d479
- 6ba7b810-9dad-11d1-80b4-00c04fd430c8
- All 32 hex digits, hyphens in positions 9, 14, 19, 24. The 13th digit is always '4' (v4). Digit 17 is 8, 9, a, or b.
Common Use Cases
- โ
Generating primary keys for database records without a central counter
- โ
Creating unique identifiers for microservices and distributed systems
- โ
Generating session tokens, file names, or correlation IDs
- โ
Creating unique slugs for user-generated content
- โ
Producing test data with realistic-looking IDs
- โ
Generating API keys for development and testing environments
Frequently Asked Questions
What is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit label used to uniquely identify information in computer systems. It's defined by RFC 4122 and formatted as 32 hexadecimal characters in 5 groups: 8-4-4-4-12. The 'universally unique' property means you can generate them without coordination and they'll be unique globally.
What is the difference between UUID v1, v4, and v7?
UUID v1 is time-based (contains the node MAC address and timestamp โ a privacy concern). UUID v4 is random (122 bits of randomness โ most common for general use). UUID v7 is a newer standard combining Unix timestamp with randomness โ sort-friendly and increasingly used in modern databases.
Can I use UUIDs as database primary keys?
Yes, and there are tradeoffs. UUIDs avoid ID enumeration attacks and work well in distributed systems. However, random v4 UUIDs fragment B-tree indexes because inserts are random, hurting performance on large tables. UUID v7 or ULID are better for database primary keys because they're time-ordered.
Is a UUID truly unique?
UUID v4 has 2^122 possible values. The probability of generating a collision is so small it's effectively impossible in any real-world scenario. You'd need to generate over a billion UUIDs per second for 100 years to have a meaningful collision risk. For practical purposes: yes, they are unique.
What is a ULID and how does it differ from UUID?
A ULID (Universally Unique Lexicographically Sortable Identifier) is a 128-bit identifier like UUID but encoded in base 32 and designed to be lexicographically sortable by creation time. This makes ULIDs much better for database indexes than random UUIDs while still being globally unique.