UUID v4 Generator
Generate random UUID v4 identifiers instantly — the most widely used UUID version, built entirely from cryptographically secure random bytes. Free, browser-only, no signup.
What Is It
UUID v4 Generator: What Is a UUID v4?
This UUID v4 generator produces the fully random variant of the UUID standard defined in RFC 9562 (formerly RFC 4122). Out of its 128 bits, 122 bits are randomly generated using a cryptographically secure random number generator, while the remaining 6 bits are fixed to mark the version (4) and variant.
Because it carries no embedded timestamp, MAC address, or other identifying information, UUID v4 is the safest default choice when you need a unique identifier that reveals nothing about when or where it was created.
Anatomy
UUID v4 Format
Every UUID v4 follows the same 8-4-4-4-12 hexadecimal pattern as other UUID versions, but two positions are fixed and instantly recognizable:
| Position | Value | Meaning |
|---|---|---|
| 13th character | 4 | Always the digit 4 — marks this as version 4 |
| 17th character | 8, 9, a, or b | Variant bits (RFC 9562 variant) |
| All other positions | Random hex | 122 bits of cryptographically secure randomness |
Example: f47ac10b-58cc-4372-a567-0e02b2c3d479 — notice the 4 and the a in fixed positions.
Comparison
UUID v4 vs UUID v7 — Which Should You Use?
| UUID v4 | UUID v7 | |
|---|---|---|
| Basis | 122 bits random | Unix ms timestamp + random |
| Sortable by creation time | No | Yes |
| Best for | Tokens, secrets, opaque IDs | Database primary keys |
| Database index performance | Poor at scale (random inserts) | Excellent (sequential-ish inserts) |
| Reveals creation time | No | Yes (by design) |
Quick rule of thumb
If you don’t want anyone to infer when a record was created, or you’re generating an API token/secret, use v4. If you’re creating a new database primary key in 2026, most teams now default to v7 for its indexing benefits.
Code
Generate a UUID v4 in Code
Need more languages? See our full code guides for Python, Java, PHP, Go, Rust, and more.
FAQ