UUID Generator

Generate universally unique identifiers. v4 for randomness. v7 for time-ordered primary keys. Bulk mode for seeding databases.

×
UUIDs

🟢📖 UUID v4 vs v7 — Which Should You Use?

UUID v4 (RFC 9562 §5.4) uses 122 bits of random data. Collision probability: ~1 in 2.7×1018 for a 50% chance. Perfect for distributed ID generation where you don't care about ordering.

UUID v7 (RFC 9562 §5.7) embeds a Unix timestamp in milliseconds as the first 48 bits, with random data for the remaining 74 bits. This makes v7 UUIDs sortable by creation time — a property v4 lacks. Databases (PostgreSQL, MySQL) perform dramatically better with sequential primary keys than random ones. If you're using UUIDs as database keys, use v7.

When to use each: v4 for API request IDs, session tokens, non-database identifiers. v7 for database primary keys, event sourcing IDs, and any use case where time-ordering matters.

See also: UUID v4 vs v7: Database Performance Guide · UUID Collision Estimator · Unix Timestamp Converter