UUID/GUID Generator

UUID Version Selection
Generated UUIDs
UUID Decoder & Validator
UUID Version Info
Version 4 - Random

Randomly generated UUID with 122 bits of randomness. Most commonly used version for general purposes.

UUID Structure

Standard UUID format:

xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx
  • M: Version digit (1-7)
  • N: Variant bits (8, 9, A, or B)
  • Total: 128 bits / 32 hex digits
Common Use Cases
  • 🗄️ Database Primary Keys
  • 📡 API Resource IDs
  • 🔗 Unique Identifiers
  • 📊 Distributed Systems
  • 🔄 Message IDs
Quick Actions

UUID v4 - Random UUIDs

UUID v4 fills 122 of its 128 bits with cryptographically secure randomness - collision odds stay negligible at any realistic scale, which is why v4 is the default for primary keys and API identifiers.

How this version compares with the other six - and when each one earns its keep - is covered in UUID versions explained.

When to Use This Version

Use UUID v4 for almost everything: database primary keys, API resource IDs, session tokens, correlation IDs. It's the default choice when you don't need time-ordering or deterministic generation. The collision probability is astronomically low - 2.71 quintillion UUIDs for 50% chance.

Best Practices

V4 is simple and effective for most use cases. Store as binary (16 bytes) in databases for efficiency. Use lowercase hex format (RFC 4122 standard) unless working with Microsoft systems. Don't try to extract information from v4 - it's pure random.

Compare with Other Versions

UUID Version 4 Questions

UUID v4 is a randomly generated identifier with 122 bits of randomness (6 bits are reserved for version and variant). It's the most commonly used UUID version for general-purpose unique identifiers.

Simple: no coordination needed, no machine identity leakage, no timestamp to worry about. Just 122 random bits. Works everywhere, generates fast, collisions are astronomically improbable.

With 2^122 possibilities, you'd need to generate 2.71 quintillion UUIDs to have a 50% collision chance. At 1 billion per second, that's 86 years. Practically speaking: unique.

When you need time-ordering (use v7), deterministic IDs from names (use v5), or extractable timestamps (use v1/v6/v7). V4 is pure random - great for most cases, but not all.