What is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit identifier guaranteed to be unique across all systems. Learn what UUIDs are, how they work, and why they're used.
A UUID is a 128-bit number used to uniquely identify information in computer systems. It is designed to be globally unique without requiring a central authority to issue them — making it ideal for distributed systems.
UUID Format
A UUID looks like this: 550e8400-e29b-41d4-a716-446655440000 It is 32 hexadecimal characters split into 5 groups by hyphens (8-4-4-4-12). The standard representation is lowercase.
UUID Versions
There are several UUID versions: • v1 — Based on timestamp and MAC address • v3 — MD5 hash of a namespace and name • v4 — Randomly generated (most common) • v5 — SHA-1 hash of a namespace and name UUID v4 is the most widely used because it is simple, fast, and practically guaranteed to be unique.
Why Use UUIDs?
UUIDs are ideal for: • Database primary keys in distributed systems • Identifying records without a central counter • File names, session tokens, and API keys • Merging data from multiple sources without ID conflicts
Try it yourself
Generate UUIDsAbout UUID
UUID is standardized by RFC 4122. The probability of two random UUIDs (v4) colliding is astronomically low — you would need to generate 1 billion UUIDs per second for 85 years before a 50% chance of a collision.
FAQ
- What is the difference between UUID and GUID?
- GUID (Globally Unique Identifier) is Microsoft's implementation of the UUID standard. They are functionally equivalent — GUID is the Windows/COM terminology, UUID is the standard term.
- Can two UUIDs ever be the same?
- Theoretically yes, but the probability is so low it is considered practically impossible. UUID v4 has 122 random bits, giving 5.3×10³⁶ possible values.
- Should I use UUID as a database primary key?
- Yes, especially in distributed systems. The trade-off is larger storage size (16 bytes vs 4 bytes for int) and slightly slower indexed queries compared to sequential integers.
Related Tools
Date Calculator
Calculate the difference between two dates in days, weeks, months, and years
Percentage Calculator
Calculate percentages, discounts, increases, and percentage differences
Image Compressor
Compress and resize images to reduce file size while maintaining quality
JSON Formatter
Format and beautify JSON data with syntax highlighting