Toolram
📖 Glossary

What is UUID?

Short answer: A UUID (Universally Unique Identifier) is a 128-bit identifier expressed as 32 hexadecimal characters in 5 groups separated by hyphens (8-4-4-4-12).

Detailed explanation

UUIDs guarantee uniqueness without central coordination: any system can generate one and the probability of collision with another UUID anywhere in the world is practically zero (1 in 5.3 × 10^36 for UUID v4). 5 versions exist: v1 based on MAC + timestamp, v3 MD5 hash of namespace+name, v4 random (most used), v5 SHA-1 hash, v7 time-orderable (new).

Example

550e8400-e29b-41d4-a716-446655440000 (UUID v4)

Common use cases

  • Primary keys in distributed databases
  • Transaction IDs in APIs
  • File upload IDs
  • Session identifiers
  • Tracking IDs in analytics

Frequently asked questions

What does UUID stand for?

Universally Unique Identifier: a 128-bit value written as 36 characters, designed so separate systems can generate IDs without coordinating.

Which version should I use?

Version 4, the random one, covers almost every case. Version 7 is worth knowing about because it sorts by time, which helps database indexes.

Can I use a UUID as a database primary key?

Yes, and it is common in distributed systems. The trade-off is size and index fragmentation compared with an auto-incrementing integer.

🇲🇽 También disponible en español