UUID Generator
Generate random UUIDs (Universally Unique Identifiers) instantly. Create version 4 UUIDs for databases, APIs, and applications.
Generated UUID
V4 · 1 generateda8c330ec-9f62-47cd-b4f6-c5129d20ce45
About UUID versions
- v4 (Random)
- 122 random bits. Best for general-purpose unique identifiers where ordering doesn't matter.
- v7 (Time-ordered)
- 48-bit timestamp + 74 random bits. Sortable by creation time - ideal for database primary keys.
What is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit identifier designed to be unique across all systems without requiring a central authority. Also known as GUIDs (Globally Unique Identifiers) in Microsoft ecosystems, UUIDs are formatted as 32 hexadecimal digits displayed in five groups separated by hyphens:
550e8400-e29b-41d4-a716-446655440000The format is 8-4-4-4-12 characters, representing the 128 bits in a human-readable form.
UUID versions
There are several UUID versions, each with different generation methods:
| Version | Name | Generation Method |
|---|---|---|
| v1 | Time-based | Timestamp + MAC address |
| v2 | DCE Security | Timestamp + MAC + local domain |
| v3 | Name-based (MD5) | MD5 hash of namespace + name |
| v4 | Random | Cryptographically random |
| v5 | Name-based (SHA-1) | SHA-1 hash of namespace + name |
| v7 | Time-ordered | Timestamp + random (new standard) |
Version 4 is the most commonly used -it generates UUIDs from cryptographically secure random numbers. The only fixed bits are the version (4) and variant indicators.
Why use UUIDs?
No coordination required - Unlike auto-incrementing database IDs, UUIDs can be generated independently by any system without risk of collision. This is essential for distributed systems and microservices.
Unpredictable - Random UUIDs don’t reveal information about creation order or volume. Sequential IDs like /users/1, /users/2 expose how many records exist and allow enumeration attacks.
Merge-friendly - When combining data from multiple sources, UUIDs won’t conflict. Two databases with auto-incrementing IDs would have colliding primary keys.
Client-side generation - Applications can generate IDs before sending data to the server, enabling optimistic UI updates and offline-first architectures.
UUID collision probability
With 122 random bits (6 bits are fixed for version and variant), UUID v4 has 2^122 possible values -over 5 undecillion combinations.
To have a 50% chance of a collision, you’d need to generate approximately 2.7 quintillion UUIDs. If you generated 1 billion UUIDs per second, it would take about 85 years to reach that point.
For practical purposes, UUID collisions are not a concern.
Common use cases
Database primary keys - Many modern databases support UUID columns natively. PostgreSQL has a uuid type, MySQL has BINARY(16) or CHAR(36).
API resource identifiers - Using UUIDs in URLs (/api/orders/550e8400-e29b-41d4-a716-446655440000) prevents enumeration and doesn’t expose business metrics.
Distributed systems - Microservices can generate IDs independently without a central ID service becoming a bottleneck or single point of failure.
Session tokens - UUIDs make suitable session identifiers when cryptographic randomness is used for generation.
File naming - Uploaded files can be stored with UUID names to prevent conflicts and avoid exposing original filenames.
UUIDs vs other identifiers
| Type | Example | Pros | Cons |
|---|---|---|---|
| Auto-increment | 12345 | Simple, compact, sortable | Requires coordination, predictable |
| UUID v4 | 550e8400-e29b-... | No coordination, unpredictable | Large (36 chars), not sortable |
| UUID v7 | 018e4b6c-... | Sortable, no coordination | Newer, less supported |
| ULID | 01ARZ3NDEKTSV... | Sortable, compact, no coordination | Less standardised |
| Snowflake | 1541815603606036480 | Sortable, compact | Requires coordination |
How this tool works
Click to generate cryptographically random version 4 UUIDs. Generation happens entirely at the edge via a QuantCDN Edge Function -using secure randomness from the runtime environment.