← All Guides
🛠️ Developer Tools

UUID v4: The Complete Guide to Random Identifiers

4 min read · Updated June 2026

UUID v4 (Universally Unique Identifier version 4) is the most widely used identifier format in modern software. It's random, collision-resistant, and doesn't require coordination between systems.

What Does a UUID Look Like?

550e8400-e29b-41d4-a716-446655440000

The format is 8-4-4-4-12 hexadecimal characters (32 hex digits + 4 hyphens = 36 characters total). The "4" in the third group identifies it as version 4.

How Random Is UUID v4?

UUID v4 uses 122 bits of randomness (6 bits are fixed for version/variant). The number of possible UUIDs is 2¹²² ≈ 5.3 × 10³⁶ — more than the number of grains of sand on Earth.

Collision Probability

To have a 50% chance of a single collision, you'd need to generate about 2.71 quintillion UUIDs. In practice, collisions are virtually impossible.

UUID v4 vs Auto-Increment IDs

AspectUUID v4Auto-Increment
UniquenessGlobalTable-local only
PredictabilityUnpredictableSequential/guessable
Merge dataNo conflictsConflicts likely
Index performanceSlower (random)Faster (sequential)
Storage16 bytes (or 36 chars)4-8 bytes

When to Use UUIDs

  • Distributed systems where nodes generate IDs independently
  • Public-facing URLs where you don't want guessable IDs
  • Merging data from multiple databases
  • File names, session tokens, request IDs

🔑 Generate UUIDs Instantly

Use our UUID v4 Generator to batch-generate up to 100 UUIDs per click — cryptographically secure, RFC 4122 compliant.

The Bottom Line

  1. UUID v4 is 122 bits of randomness — collisions are practically impossible
  2. Use UUIDs for distributed systems and public identifiers
  3. Auto-increment is better for internal tables where sequential order matters
  4. Always use crypto.getRandomValues() for generating UUIDs in JavaScript

Disclaimer: This guide is for informational purposes only.