Skip to main content

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โ€‹

VersionSpecificationBit AllocationPrimary Use CaseDatabase Index Behavior
UUIDv7RFC 956248-bit timestamp + 74 random bitsHigh-concurrency primary keysClustered sequential inserts (optimal B-tree caching)
UUIDv4RFC 4122122 cryptographically random bitsTransient tokens, API session IDsHigh fragmentation on clustered indexes
UUIDv5RFC 4122160-bit SHA-1 hash truncated to 128 bitsDeterministic resource mapping across distributed systemsDepends on input name entropy
UUIDv1RFC 412260-bit 100ns timestamp + 48-bit MAC nodeLegacy systems requiring physical hardware provenancePeriodic 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/urandom on Unix or CryptGenRandom on Windows).
  • Ephemeral Local History: Generation history is stored strictly in client localStorage for 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.