Introduction

UUID (Universally Unique Identifier) and GUID (Globally Unique Identifier) are both used for generating unique identifiers. But what’s the difference, and when should you use each?

What are They?

UUID

  • Standard: RFC 4122
  • Format: 128-bit identifier
  • Representation: 32 hex digits in 5 groups (8-4-4-4-12)
  • Example: 550e8400-e29b-41d4-a716-446655440000

GUID

  • Standard: Microsoft’s implementation
  • Format: Same as UUID (128-bit)
  • Representation: Same format as UUID
  • Example: 550e8400-e29b-41d4-a716-446655440000

The Difference

In practice: They’re the same!

  • GUID is Microsoft’s name for UUID
  • Both use the same format
  • Both serve the same purpose
  • Both are 128-bit identifiers

Historical context:

  • UUID was standardized in RFC 4122
  • GUID was Microsoft’s name before standardization
  • Today, they’re used interchangeably

UUID Versions

UUID v1 (Time-based)

// Based on MAC address + timestamp
// Not recommended for privacy

UUID v4 (Random)

// Random UUID - most common
// Recommended for most use cases

UUID v5 (Name-based)

// Based on namespace + name (SHA-1)
// Deterministic - same input = same UUID

Tools

Use our tools:

Conclusion

UUID and GUID are essentially the same:

Use when:

  • Need unique identifiers
  • Distributed systems
  • Database primary keys
  • API resource IDs

Recommendations:

  • Use UUID v4 for random IDs
  • Use UUID v5 for deterministic IDs
  • Avoid UUID v1 (privacy concerns)

Next Steps