What is a UUID? Complete Guide to UUID v4 Generation
Understand UUIDs (Universally Unique Identifiers) — what they are, different versions (v1–v5), why UUID v4 is the most popular, and how to generate them instantly.
What is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit identifier formatted as a 32-character hexadecimal string with hyphens: 550e8400-e29b-41d4-a716-446655440000. UUIDs are designed to be globally unique — generated independently on different machines without any central coordinating authority.
The term GUID (Globally Unique Identifier) is Microsoft's name for the same concept.
UUID Versions Explained
- UUID v1 — based on the current timestamp and the machine's MAC address. Unique but reveals time and hardware info, which can be a privacy concern.
- UUID v2 — rarely used DCE Security variant based on POSIX UID/GID. Avoid.
- UUID v3 — deterministic, generated by MD5-hashing a namespace + name. Same inputs always produce the same UUID.
- UUID v4 — randomly generated. Most widely used. 122 bits of cryptographic randomness, making collisions astronomically unlikely.
- UUID v5 — like v3 but uses SHA-1 hashing instead of MD5. Preferred over v3 when determinism is needed.
Why UUID v4 Is So Popular
UUID v4 is the default choice for most developers because:
- No central server needed to issue IDs (unlike auto-increment integers)
- No time or hardware information embedded (privacy-safe unlike v1)
- Collision probability is negligible — generating 1 billion UUIDs per second for 100 years would have a 50% chance of producing just one collision
- Works perfectly for distributed systems where multiple services generate IDs independently
UUID vs Auto-Increment ID
- Auto-increment — sequential, predictable, exposes record count, doesn't work across merged databases
- UUID — random, unpredictable, safe to expose publicly, works across any number of distributed nodes
The trade-off: auto-increment INT uses 4 bytes and is faster to index in databases; UUID uses 16 bytes and can cause B-tree fragmentation with random inserts. For most applications the difference is negligible.
UUID v7 — The New Standard
UUID v7 (RFC 9562, 2024) combines a millisecond-precision timestamp prefix with randomness. This makes them time-sortable (like v1) while maintaining the privacy benefits of v4. Many modern systems are adopting v7 as the new default.
Using the ToolsPal UUID Generator
- Click Generate to create a UUID v4 instantly
- Generate multiple UUIDs in bulk (up to 100 at once)
- Copy individual UUIDs or the entire list
Free Online Tool
Try UUID Generator
Generate one or many UUID v4 strings instantly.