UUID Generator
Generate random UUID v4 identifiers for use in databases, APIs, and applications.
What is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit identifier standardised by RFC 4122. The term "universally unique" means that any UUID generated anywhere in the world, at any time, by any system, is β with overwhelming probability β unique. UUIDs are represented as 32 hexadecimal digits displayed in five groups separated by hyphens: 8-4-4-4-12 characters.
UUID format: xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx
M = version (1, 3, 4, or 5)
N = variant (8, 9, a, or b for RFC 4122)
Example UUID v4 (random):
550e8400-e29b-41d4-a716-446655440000UUID versions compared
| Version | Based on | Use when |
|---|---|---|
| v1 | Timestamp + MAC address | You need time-sortable IDs; note: reveals machine MAC address |
| v3 | MD5 hash of namespace + name | Deterministic ID from a name (same input β same UUID always) |
| v4 | Random / pseudo-random | Default choice for database primary keys and session IDs |
| v5 | SHA-1 hash of namespace + name | Deterministic like v3 but with stronger hashing |
| v7 (draft) | Unix timestamp + random bits | Modern replacement for v1 β time-sortable without MAC exposure |
UUIDs vs. auto-increment IDs: when to use each
Auto-increment integers (1, 2, 3β¦) are simple, compact, and fast to generate, but reveal your data volume, are predictable (attackers can enumerate /user/1, /user/2β¦), and cause conflicts when merging data from multiple sources. UUIDs solve all three problems at the cost of larger storage (16 bytes vs. 4 bytes) and less human-friendly values.
Auto-increment: sequential, predictable, small
β Internal admin tools, simple single-database apps
β Public URLs, multi-database systems, distributed generation
UUID v4: random, unpredictable, globally unique
β Public-facing IDs, microservices, distributed systems
β When you need sorted IDs (use v7 or ULID instead)Frequently asked questions
What is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit value, usually shown as 36 characters with hyphens, used to label data uniquely without a central authority.
What is a version 4 UUID?
Version 4 UUIDs are generated from random numbers. They are the most common type because they require no input data and have a negligible chance of collision.
Are UUIDs guaranteed to be unique?
Not absolutely, but the probability of two random v4 UUIDs colliding is so astronomically small that they are treated as unique in practice.
When should I use a UUID instead of an auto-increment ID?
Use UUIDs when IDs must be generated by many systems independently, kept unguessable, or merged across databases without conflicts.
Generates UUID version 4 identifiers β randomly generated 128-bit unique IDs used in databases, APIs, distributed systems and URLs to identify records without a central authority.
UUID v4: randomly generated 128-bit identifier. 2^122 possible values.