Skip to main content

What is UUID?

UUID (Universally Unique Identifier) is a 128-bit label used for information in computer systems. The term GUID (Globally Unique Identifier) is also used, especially in Microsoft systems.

UUID Structure

A standard UUID looks like this: 550e8400-e29b-41d4-a716-446655440000. It consists of 32 hexadecimal digits displayed in 5 groups separated by hyphens (8-4-4-4-12).

550e8400-e29b-41d4-a716-446655440000
time_low (8) time_mid (4) time_hi_version (4) clock_seq (4) node (12)

Why Use UUIDs?

Unique across all systems without central authority
Can be generated offline
Perfect for distributed databases
No sequential patterns to predict
Standard format recognized worldwide

Common Use Cases

1
Database primary keys
2
Session identifiers
3
API request tracking
4
File naming in storage systems
5
Distributed system synchronization

Technical Details

Size and Format

  • 128 bits (16 bytes) total length
  • 32 hexadecimal characters
  • 36 characters with hyphens
  • Standard format per RFC 4122

Collision Probability

With UUID v4, you would need to generate approximately 2.71 × 1018 UUIDs to have a 50% chance of one collision. That's equivalent to generating 1 billion UUIDs per second for about 85 years.

Compatibility

UUIDs are natively supported in most modern databases (PostgreSQL, MySQL 8.0+, SQL Server, Oracle) and programming languages (Java, Python, JavaScript, PHP, C#, Go, Rust).