UUID Generator
Generate random, deterministic, and time-ordered UUIDs.
6ba7b810-9dad-11d1-80b4-00c04fd430c8
Hashing…
How It Works
v4 uses crypto.randomUUID() — cryptographically random, 122 bits
of entropy. The probability of a collision across 1 billion UUIDs is about 1 in 1018.
v5 generates a deterministic UUID from a namespace and a name using a SHA-1 hash. The same inputs always produce the same UUID. Useful for stable IDs derived from natural keys — for example, a consistent UUID for a domain name or a database row identified by a natural key.
v7 embeds a 48-bit Unix millisecond timestamp in the first 6 bytes, followed by random bits. Because the timestamp comes first, v7 UUIDs sort lexicographically in generation order — making them well-suited as primary keys in databases where UUID ordering matters for index performance.
Base64 encoding represents the 16 raw UUID bytes as a 24-character string (22 characters in base64url without padding). Useful when you need a compact, URL-safe identifier.