🆔 UUID Generator
Generate random v4 UUIDs. Runs entirely in your browser — nothing is sent to a server.
- Click "Generate" to create UUIDs
What is a UUID and Why Use UUID v4 for Unique Identifiers?
A UUID (Universally Unique Identifier), also known as a GUID (Globally Unique Identifier) in Microsoft ecosystems, is a 128-bit identifier that is unique across space and time. UUIDs are the industry standard for generating unique IDs in distributed systems where a central authority isn't available. The format is xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx — 32 hex digits separated by 4 hyphens.
UUID Versions Explained
- UUID v1 — Based on timestamp and MAC address. Guarantees uniqueness but leaks hardware identity and creation time. Rarely used in modern applications.
- UUID v4 (this tool) — Randomly generated using a CSPRNG. 122 bits of randomness yield 5.3 × 10³⁶ possible values — making collisions statistically impossible (you'd need to generate 1 billion UUIDs per second for 86 years to have a 50% chance of one collision).
- UUID v5 — Deterministic, generated by hashing a namespace + name with SHA-1. Same input always produces the same UUID. Useful for consistent ID generation.
- UUID v7 (new) — Time-ordered UUIDs that combine timestamp and randomness. Sortable by creation time, making them excellent for database primary keys.
Common Use Cases for UUID v4 in Software Development
- Database primary keys — UUIDs as primary keys in PostgreSQL (
uuidtype), MySQL, MongoDB, and DynamoDB avoid sequential ID enumeration attacks - Session identifiers — Web application sessions, shopping carts, and temporary tokens
- API request correlation IDs — Track requests across microservices with a unique
X-Request-IDheader - Distributed systems — Generate unique IDs on multiple servers without coordination or a central ID authority
- File naming — Unique filenames for user uploads to prevent overwriting (
a3f4b2c1-...-image.png) - Message queues — Unique message IDs in Kafka, RabbitMQ, SQS for idempotency and deduplication
UUID v4 vs Auto-Increment IDs vs ULID
- Auto-increment IDs — Sequential, predictable, requires a central database. Leaks record count and creation order. Not suitable for distributed systems.
- UUID v4 — Random, globally unique, no coordination needed. Downside: not sortable by time, poor database index locality on B-tree indexes.
- ULID — Lexicographically sortable, timestamp-prefixed, compatible with UUID storage. Better database performance than random UUIDs.