UUID Generator — RFC 9562 v4, v7 & Nil UUID Technical Guide
Generate RFC 9562 compliant UUID v4 (random), v7 (time-ordered), and Nil UUIDs client-side using crypto.getRandomValues() for cryptographically secure entropy.
01. UUID Standards: RFC 9562 Version 4 & 7 Structure
A Universally Unique Identifier (UUID) is a 128-bit label standardized in RFC 9562. The canonical text format uses 32 hexadecimal digits grouped as 8-4-4-4-12 separated by hyphens. The M nibble encodes the version (4 or 7) and the N nibble encodes the variant (10xx for RFC 9562 compliant UUIDs).
UUID v4 uses 122 bits of cryptographically random data. With crypto.getRandomValues() providing 122 bits of entropy, the probability of UUID collision in 1 billion generated IDs is approximately 1 in 5.3 x 10^20 — statistically negligible for any practical system.
UUID v7 (new in RFC 9562) embeds a 48-bit Unix millisecond timestamp in the most significant bits, followed by 74 bits of random data. Unlike v4, v7 UUIDs are lexicographically sortable by creation time, making them significantly more efficient as primary keys in B-tree database indexes.
- UUID v4 (RFC 9562 §5.4): 122 random bits — global uniqueness without coordination.
- UUID v7 (RFC 9562 §5.7): 48-bit ms timestamp + 74 random bits — sortable database PKs.
- Nil UUID (RFC 9562 §5.9): 00000000-0000-0000-0000-000000000000 — sentinel placeholder.
- COMB UUIDs: timestamp-prefixed v4 hybrid — widely used in ORMs for index performance.
UUID v4 random primary keys cause 50-80% B-tree page fragmentation in PostgreSQL and MySQL at scale. UUID v7 monotonically increasing prefix eliminates fragmentation, achieving near-sequential INSERT performance comparable to auto-increment integers.
02. Entropy Sources & Uniqueness Guarantees
Browser UUID generation uses crypto.getRandomValues(), which reads from the operating system CSPRNG: /dev/urandom on Linux, CryptGenRandom on Windows, and SecRandomCopyBytes on macOS/iOS. These CSPRNGs are seeded from hardware entropy sources including CPU timing jitter and thermal sensor noise.
Math.random() must never be used for UUID generation: it is a deterministic PRNG with only 32-64 bits of internal state, making it trivially predictable and unsuitable for unique identifier generation in security-sensitive contexts.
- crypto.getRandomValues(): CSPRNG-backed — cryptographically unpredictable per W3C spec.
- Math.random(): Deterministic PRNG — NOT suitable for UUID generation.
- UUID v7 timestamp: millisecond precision per RFC 9562 — sortable without clock sync.
Frequently Asked Questions (FAQ)
Should I use UUID v4 or v7 for database primary keys?
UUID v7 is recommended for new database schemas. Its monotonically increasing timestamp prefix eliminates B-tree fragmentation and delivers better INSERT performance at scale.
Are UUIDs generated here truly random?
Yes. This tool uses crypto.getRandomValues() from your OS CSPRNG. The 122 random bits in v4 make collisions statistically impossible in practice.
What is the Nil UUID used for?
The Nil UUID (all zeros) is a sentinel value defined in RFC 9562 §5.9, used as a placeholder when a UUID field is required but no actual ID has been assigned yet.
Is my confidential data uploaded to external servers when using UUID & GUID Generator — Bulk UUID v4 & UUID v7 (RFC 9562)?
No. Core processing in UUID & GUID Generator — Bulk UUID v4 & UUID v7 (RFC 9562) executes in volatile browser memory without server uploads. Inputs to local tools are not logged on remote servers; optional cloud-assisted features require user consent.
Can I use UUID & GUID Generator — Bulk UUID v4 & UUID v7 (RFC 9562) offline without an active internet connection?
Offline use requires the page and its tool assets to finish caching first. Core transformations can then run locally; optional AI and contact delivery require internet.
Is UUID & GUID Generator — Bulk UUID v4 & UUID v7 (RFC 9562) free to use with any rate limits or paywalls?
Core tools are free to use without an account. Device memory and tool-specific safety limits apply. Optional AI and online contact services have usage limits.