Skip to content
yutils
Example

Options

Version: UUID v7
Count: 3
Uppercase: off

Output (UUID v7 · 3 ids)

0192f5a4-b6e0-7c1e-9d4f-1a2b3c4d5e6f
0192f5a4-b6e1-7203-8a9b-cd1234ef5678
0192f5a4-b6e2-7c01-b1c2-aabbccddeeff

Note

v7's leading 48 bits are an ms timestamp, so IDs sort chronologically. Within the same millisecond the trailing random bits differ — collision probability is effectively zero.

Usage / FAQ

When to use

  • Generate unique identifiers for database primary keys
  • Get collision-free IDs across distributed systems (UUID v4)
  • Time-ordered IDs for better DB index locality (UUID v7 / ULID)
  • Fill mock test data with realistic ID fields
  • Random session tokens with effectively zero collision probability

FAQ

Q.UUID v4 vs v7?
A.v4 is 122-bit fully random — most common but poor DB index locality. v7 (RFC 9562, 2024) uses 48-bit ms timestamp + random — time-ordered, index-friendly.
Q.What's ULID?
A.ULID is Crockford Base32, 26 chars — more human-readable, also time-sortable. Shorter and URL-safe than UUID.
Q.Which one should I use?
A.For new DB primary keys, UUID v7 or ULID recommended. For external API compatibility, v4 stays the safe default. For human-facing trace IDs, ULID's compactness wins.
Fun facts
  • UUID v4 has 2¹²² ≈ 5.3 × 10³⁶ possible values. Generating one billion per second, you would need roughly 85 billion years before there's a 50% chance of any two colliding — about six times the age of the universe (13.8 billion years). That's where "practically impossible to collide" comes from.

    Wikipedia — UUID collisions
  • UUIDs trace back to Apollo Computer's NCS (Network Computing System) in the 1980s. The goal: make collision-free IDs in distributed systems without any central authority. That work eventually became DCE and was standardized as RFC 4122 in 2005.

    RFC 4122
  • UUID v7 was formalized as RFC 9562 in May 2024. v4 is fully random — terrible for DB index locality. v7 uses a 48-bit millisecond timestamp prefix, giving you time-ordering AND index friendliness in the same value. For new systems, v7 is the recommended default.

    RFC 9562 (2024)