UUID Generator
Generate unique UUIDs (Universally Unique Identifiers)
What is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit identifier designed to be unique across all
space and time. Standardized by RFC 4122, UUIDs follow the format xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx
where M indicates the version and N indicates the variant.
This tool generates Version 4 (random) UUIDs using cryptographically secure random numbers. With 122 random bits, the chance of collision is astronomically small—you could generate a billion UUIDs per second for 100 years and still have less than a 50% chance of a single duplicate.
UUID Versions Explained
Based on timestamp and MAC address. Sortable by time but reveals device identity.
Generated from a namespace and name using MD5. Same input always produces same UUID.
Randomly generated. Most common choice for unique identifiers. No information leakage.
Like v3 but uses SHA-1. Preferred over v3 for name-based UUIDs.
New standard with Unix timestamp. Sortable, random, and doesn't reveal MAC address.
Common Use Cases
🗄️ Database Primary Keys
UUIDs allow generating IDs client-side without database coordination. Ideal for distributed systems where multiple nodes need to create records simultaneously.
🔐 Session & Token IDs
Secure session identifiers, API tokens, and temporary access codes. The randomness makes them unguessable, preventing enumeration attacks.
📁 File & Resource Naming
Generate unique filenames for uploads, cache keys, or temporary files. Prevents naming conflicts without needing a centralized naming service.
🔄 Distributed Systems
Event IDs, message IDs, correlation IDs for tracing requests across microservices. Each service can generate IDs independently.
Frequently Asked Questions
Will I ever get a duplicate UUID?
Practically, no. A v4 UUID has 2¹²² possible values (5.3 × 10³⁶). To have a 50% chance of a collision, you'd need to generate about 2.7 × 10¹⁸ UUIDs—that's 2.7 quintillion.
Should I use UUID or auto-increment IDs?
Use auto-increment for simple apps with a single database. Use UUIDs for distributed systems, when IDs are generated client-side, or when you don't want to expose sequential ordering (security).
Are UUIDs good for database performance?
Random UUIDs can cause B-tree index fragmentation. Consider using UUID v7 (time-ordered) or storing as binary(16) instead of varchar(36) for better performance. Some databases have native UUID types.
What's the difference between UUID and GUID?
They're essentially the same thing. GUID (Globally Unique Identifier) is Microsoft's term for UUID. Both refer to 128-bit identifiers following the same specification.
UUID Format Reference
No Dashes: 550e8400e29b41d4a716446655440000
Braces: {550e8400-e29b-41d4-a716-446655440000}
URN: urn:uuid:550e8400-e29b-41d4-a716-446655440000
Uppercase: 550E8400-E29B-41D4-A716-446655440000