Skip to main content

UUID Generator

Generate unique identifiers (UUIDs) for your applications

About UUIDs (Universally Unique Identifiers)

What is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit identifier that is guaranteed to be unique across time and space. UUIDs are standardized by the Open Software Foundation (OSF) and are used in distributed systems to uniquely identify resources without requiring a central coordinating authority.

  • 128-bit identifier: Consists of 32 hexadecimal digits displayed in 5 groups separated by hyphens
  • Globally unique: The probability of generating duplicate UUIDs is virtually zero
  • Standard format: Example: 550e8400-e29b-41d4-a716-446655440000
  • Multiple versions: Different UUID versions serve different purposes

UUID Versions

Version Name Description Use Cases
v1 Time-based Based on MAC address and timestamp When you need time-ordered UUIDs, distributed systems with time requirements
v4 Random Generated using random or pseudo-random numbers Most common use case, general purpose unique identifiers

Common Use Cases

  • Database Primary Keys: Use UUIDs as primary keys to avoid collisions in distributed databases
  • API Identifiers: Generate unique IDs for REST API resources
  • Session Management: Create unique session identifiers
  • File Naming: Generate unique filenames to prevent overwrites
  • Distributed Systems: Identify resources across multiple servers without coordination
  • Transaction IDs: Track transactions in payment systems
  • Event Tracking: Identify events in analytics systems

Examples

Standard format:

550e8400-e29b-41d4-a716-446655440000

Uppercase:

550E8400-E29B-41D4-A716-446655440000

No dashes:

550e8400e29b41d4a716446655440000

Time-based UUID format:

6ba7b810-9dad-11d1-80b4-00c04fd430c8

Time-based UUIDs include timestamp information, making them sortable by creation time.

Best Practices

  • Choose the right version: Use v4 for most cases, v1 when you need time ordering
  • Store as binary: For databases, consider storing UUIDs as binary (16 bytes) instead of strings (36 characters)
  • Indexing: Be aware that UUIDs can impact database indexing performance compared to sequential IDs
  • URL safety: UUIDs are URL-safe and don't require encoding
  • Privacy: v4 UUIDs don't reveal information about the system that generated them