Free UUID Generator & Decoder
Generate, format, and inspect Universally Unique Identifiers (UUIDs) directly in your browser adhering to RFC 9562 standards.
UUID Version
Quantity
Decode & Inspect UUID
Technical Architecture: Reverse-Engineering UUID Generationโ
Modern distributed architectures rely on Universally Unique Identifiers (UUIDs) to generate conflict-free primary keys across decentralized nodes without central coordination. The implementation provides in-memory generation and validation across RFC 4122 and RFC 9562 specifications.
1. Cryptographic Entropy & Bit Masking (v4)โ
UUID version 4 relies on 122 bits of cryptographically secure pseudo-random entropy generated via window.crypto.getRandomValues():
function generateV4(): string {
const bytes = new Uint8Array(16);
window.crypto.getRandomValues(bytes);
// Set RFC 4122 version to 4 (0100 in high 4 bits of byte 6)
bytes[6] = (bytes[6] & 0x0f) | 0x40;
// Set RFC 4122 variant to 1 (10 in high 2 bits of byte 8)
bytes[8] = (bytes[8] & 0x3f) | 0x80;
const hex = Array.from(bytes, b => b.toString(16).padStart(2, '0')).join('');
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
}
The probability of collision across two independently generated UUIDv4 keys is calculated using the birthday paradox:
p โ 1 - exp(-nยฒ / (2 ร 2ยนยฒยฒ))
Generating 1 billion UUIDv4s per second for 85 years yields an estimated collision probability below one in a billion.
2. Time-Ordered B-Tree Index Optimization (v7)โ
Traditional random UUIDv4 identifiers cause severe B-tree page splits, random write I/O, and cache eviction in databases like PostgreSQL, MySQL, and SQLite. UUIDv7 resolves this by encoding a 48-bit Unix millisecond timestamp at the beginning of the identifier:
function generateV7(): string {
const bytes = new Uint8Array(16);
window.crypto.getRandomValues(bytes);
const timestamp = Date.now();
// Pack 48-bit millisecond timestamp into bytes 0-5
bytes[0] = (timestamp / 0x10000000000) & 0xff;
bytes[1] = (timestamp / 0x100000000) & 0xff;
bytes[2] = (timestamp / 0x1000000) & 0xff;
bytes[3] = (timestamp / 0x10000) & 0xff;
bytes[4] = (timestamp / 0x100) & 0xff;
bytes[5] = timestamp & 0xff;
// Set version 7 (0111) and variant 1 (10)
bytes[6] = (bytes[6] & 0x0f) | 0x70;
bytes[8] = (bytes[8] & 0x3f) | 0x80;
return formatUuid(bytes);
}
Because new records contain monotonic increasing timestamps, database indexes insert nodes sequentially at the right-most edge of the index tree, achieving insertion performance comparable to auto-incrementing integers while preserving decentralized generation.
3. Namespace Determinism (v5)โ
UUID version 5 generates deterministic 128-bit identifiers by concatenating a 16-byte namespace UUID with an arbitrary UTF-8 name string, digesting the payload through SHA-1, and setting version bits to 0x50. Given identical inputs, UUIDv5 produces identical output across any language runtime or operating system.
Supported UUID Versions Comparisonโ
| Version | Specification | Bit Allocation | Primary Use Case | Database Index Behavior |
|---|---|---|---|---|
| UUIDv7 | RFC 9562 | 48-bit timestamp + 74 random bits | High-concurrency primary keys | Clustered sequential inserts (optimal B-tree caching) |
| UUIDv4 | RFC 4122 | 122 cryptographically random bits | Transient tokens, API session IDs | High fragmentation on clustered indexes |
| UUIDv5 | RFC 4122 | 160-bit SHA-1 hash truncated to 128 bits | Deterministic resource mapping across distributed systems | Depends on input name entropy |
| UUIDv1 | RFC 4122 | 60-bit 100ns timestamp + 48-bit MAC node | Legacy systems requiring physical hardware provenance | Periodic index locality |
Client-Side Security & Zero-Server Data Isolationโ
- Zero Network Egress: UUID generation and decoding run entirely within your local browser process. No requests are dispatched to any remote server or external endpoint.
- CSPRNG Entropy: Uses the browser's native
Crypto.getRandomValues()interface backed by hardware entropy pools (/dev/urandomon Unix or CryptGenRandom on Windows). - Ephemeral Local History: Generation history is stored strictly in client
localStoragefor productivity, never synced to external databases, and cleared upon clearing site storage.
Get notified about updates to this tool
No spam. Just high-quality updates about new features and guides.
Related Toolsโ
Related Postsโ
Learn why Firestore throws the error "A document must have an even number of path elements" and how to fix it by understanding the structure of Collections and Documents in Firestore.
A comprehensive developer guide to integrating databases on Vercel. Compare Vercel Postgres, KV, Blob, and Edge Config, and learn about serverless connection pooling and SDK integrations.
How to define relationships between SQLAlchemy models (e.g., one-to-many, many-to-one) purely in the Python code without creating corresponding `FOREIGN KEY` constraints in the underlying SQL database schema.


