UUID Generator
Generate random UUIDs (v4). Create single or multiple unique identifiers instantly.
71e88083-38af-4a23-a39d-5ef64317fc30f6bf18b4-b5cc-4d2e-83e8-8aa7359ee39d152343d1-8149-4026-8bc6-33c7b40d9bd79cd107f5-e74d-4dc3-be1f-586753c363607a5025d8-003e-482a-9eb3-b94310509392How to use
- 1 Click Generate to create a new UUID v4 (randomly generated, cryptographically secure).
- 2 Click Copy to grab the UUID for use in your code, database, or configuration.
- 3 Use the Batch option to generate multiple UUIDs at once.
- 4 UUIDs are statistically unique, so they are safe to use as IDs without a central coordinator.
Key features
- Generates UUID v4 using the cryptographically secure crypto.randomUUID()
- Batch generation for creating multiple UUIDs at once
- Statistically unique, safe to use as primary keys without a central authority
- Instant one-click copy
What is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit value standardized in RFC 4122, typically written as 32 hex digits in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. Version 4 UUIDs are randomly generated with 122 bits of entropy, making the chance of a collision astronomically small. At a rate of one billion UUIDs per second, you'd expect the first duplicate after roughly 2.7 million years.
Unlike auto-increment IDs, UUIDs can be generated on any machine without coordination: no database round-trip required. This makes them especially useful in distributed systems where multiple services need to create records independently before syncing.
Common Use Cases
Database primary keys
Use UUIDs as PKs to avoid sequential ID enumeration attacks and to safely merge records from multiple data sources.
Distributed systems
Generate IDs across multiple services without a central coordinator, with no locking, no contention, no single point of failure.
Idempotency keys
Attach a UUID to API requests so you can safely retry them without the server processing them twice.
File and upload naming
Name uploaded files with UUIDs to prevent collisions, avoid path traversal issues, and make URLs non-guessable.
Test data generation
Quickly generate unique IDs for seeding databases, creating mock API responses, or populating test fixtures.
Session and correlation tokens
UUIDs work well as session IDs or request correlation IDs for tracing requests across microservices.
UUID Versions at a Glance
There are multiple UUID versions, each suited for different needs.
| Version | Generation method | When to use |
|---|---|---|
| v1 | Timestamp + MAC address | When you need sortability by creation time; leaks MAC address |
| v3 | MD5 hash of namespace + name | Deterministic IDs from known inputs (same input = same UUID) |
| v4 | Random (122 bits) | General purpose, most widely used version |
| v5 | SHA-1 hash of namespace + name | Like v3 but using SHA-1; preferred over v3 |
| v7 | Unix timestamp prefix + random | Sortable, collision-safe, ideal for database PKs (RFC 9562) |
Frequently Asked Questions
What is a UUID and how is it generated?
A UUID (Universally Unique Identifier) is a 128-bit value used to uniquely identify information in computer systems. UUID v4 generates random IDs using a cryptographically secure random number generator with 122 bits of entropy, making collisions virtually impossible. UUID v7 combines a Unix timestamp with random bits, producing sortable IDs that are ideal for database primary keys.
What's the difference between UUID v4 and v7?
UUID v4 is purely random: every bit except the version and variant markers is randomly generated. UUID v7 (defined in RFC 9562) prefixes the ID with a Unix timestamp in milliseconds, making the IDs sortable by creation time. This makes v7 better suited for database primary keys because it reduces index fragmentation and improves B-tree performance.
Can two UUIDs be the same?
Theoretically yes, but practically no. UUID v4 has 122 bits of randomness, giving approximately 5.3×10³⁶ possible values. To have a 50% chance of a collision, you'd need to generate about 2.7×10¹⁸ UUIDs (2.7 quintillion). For context, generating one billion UUIDs per second for 2.7 million years would still only give you a 50% collision probability.
How many UUIDs do I need before a collision?
Due to the birthday paradox, the expected number of randomly generated UUIDs before a 50% collision chance is approximately 2.71×10¹⁸ (2.7 quintillion IDs). In practical terms, you can generate billions of UUIDs daily for millions of years before encountering a duplicate. This makes UUID v4 safe for virtually any real-world application.
What format is a UUID written in?
UUIDs follow the standard 8-4-4-4-12 hexadecimal format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. This represents 32 hex digits grouped by hyphens, totaling 36 characters (32 digits + 4 hyphens). This generator also supports uppercase hex digits and formats without hyphens, as well as bare 128-bit integer and Base64 representations for use in URLs and databases.