RFC 4122 UUID v4 Generator
Generate random, 128-bit universally unique identifiers (UUIDs) for database primary keys, distributed transaction tracing, and JWT ID (jti) claims.
RFC 4122 UUID v4 Generator
Cryptographically secure 128-bit random universally unique identifiers
How to Generate RFC 4122 Version 4 UUIDs
1. Select Output Formatting Options
Toggle standard hyphens (8-4-4-4-12 pattern) and uppercase/lowercase character display.
2. Select Generation Batch Size
Generate single identifiers or bulk batches of up to 50 UUIDs at once for database seeds.
3. Copy Identifiers
Click Copy to capture individual or bulk UUIDs for primary keys or JWT "jti" claims.
RFC 4122 v4 Mathematics & Collision Probability
A Version 4 UUID is a 128-bit identifier composed of cryptographically secure random bits. Per RFC 4122 Section 4.4, 6 bits are fixed: 4 bits denote the version (0100 for Version 4 at bits 48-51) and 2 bits denote the variant (10xx for RFC 4122 at bits 64-65). This leaves exactly 122 bits of pure entropy, yielding 2^122 (approx 5.3 x 10^36) unique values.
| Specification / Parameter | Standard & Enforced Value |
|---|---|
| Standard Specification | RFC 4122 Section 4.4 (Universally Unique ID) |
| Total Bit Length | 128 bits (16 raw bytes) |
| True Entropy Bits | 122 bits (6 bits reserved for version/variant) |
| Possible Combinations | 5,316,911,983,139,663,491,615,158,247,834,166,243 |
JWT Integration: Preventing Replay Attacks with the "jti" Claim
In JSON Web Token architectures, the optional "jti" (JWT ID) claim provides a unique identifier for the token. By populating "jti" with an RFC 4122 v4 UUID, your backend authentication system can implement token blacklisting, single-use validation, and replay attack prevention across distributed servers.
Frequently Asked Questions: UUID v4 Generation
Could two users accidentally generate the exact same UUID v4?
Mathematically, the probability is negligible (1 in 5.3 x 10^36). It is vastly more likely for a meteor to strike a data center than for an accidental UUID v4 collision to occur.
What is the difference between UUID v4 and UUID v7?
UUID v4 is completely random. UUID v7 embeds a Unix millisecond timestamp at the beginning, making it sequentially sortable in database indexes.
Does this generator use hardware random numbers?
Yes. It calls window.crypto.getRandomValues() to ensure the 16 bytes are drawn from the operating system kernel entropy pool.
Why are there hyphens in standard UUID strings?
The 8-4-4-4-12 pattern (36 characters total) is the canonical representation defined in RFC 4122 for visual readability.