UUID Generator
Generate universally unique identifiers (UUIDs) in v4, v1, or v5 format. Use them as database primary keys, API identifiers, or any system requiring unique tokens.
How to Use This Calculator
- Select a UUID version: v4 (random), v1 (timestamp-based), or v5 (namespace-based).
- If using v5, enter a Namespace UUID and a Name string.
- Choose the quantity (1–50) and format (uppercase, lowercase, or no dashes).
- Click "Generate UUIDs" and copy individual results or use "Copy All".
Formula
- Version (4 bits): The 13th hex character is always “4” for v4.
- Variant (2 bits): The 17th hex character is “8”, “9”, “a”, or “b” (RFC 4122 variant).
- 128 bits total: 122 random bits for v4, giving 2⁻⁵⁺ unique values.
- v5: SHA-1 hash of namespace + name, truncated to 128 bits.
Examples
550e8400-e29b-41d4-a716-446655440000
550e8400e29b41d4a716446655440000
Database primary keys, REST API resource identifiers, session tokens, distributed system node IDs, and transaction tracking numbers.
Frequently Asked Questions
What is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit identifier used to uniquely identify information in computer systems. It’s formatted as 32 hexadecimal digits separated by hyphens in five groups (8-4-4-4-12).
What’s the difference between UUID v1 and v4?
v1 is based on a timestamp and MAC address, making it time-sortable but potentially leaking hardware info. v4 is purely random, offering better privacy and no correlation between generation time and the UUID value.
When should I use a UUID?
Use UUIDs when you need globally unique identifiers without a central authority. Common uses include database primary keys, API resource IDs, distributed system coordination, and session management.
Are UUIDs truly unique?
Practically, yes. The probability of generating a duplicate v4 UUID is approximately 1 in 2⁻⁵⁺ — you would need to generate 1 billion UUIDs per second for 85 years to have a 50% chance of a single collision.