UUID Generator
Generate cryptographically random UUID v4 values — single or in bulk up to 100.
UUIDs: The Universal Standard for Unique Identifiers
UUIDs (Universally Unique Identifiers) are 128-bit identifiers with negligible collision probability — making them the standard for database primary keys, session tokens, request IDs, file names and distributed system identifiers. Version 4 UUIDs are randomly generated — no coordination between systems required. The probability of a collision generating 1 billion UUIDs per second for 100 years is virtually zero (1 in 10¹⁵).
Frequently Asked Questions
What is a UUID and why use it as a database primary key? ▼
UUID is a 128-bit identifier formatted as 8-4-4-4-12 hexadecimal characters (e.g., 550e8400-e29b-41d4-a716-446655440000). Benefits as a primary key: globally unique without coordination between servers, can be generated client-side before INSERT, safe for distributed systems and no sequential ID exposure (security benefit). Downside: larger index size vs integer IDs.
What is the difference between UUID v1, v4 and v7? ▼
UUID v1: time-based + MAC address — sequential but exposes creation time and machine identity. UUID v4: fully random — most widely used, no information leakage. UUID v7 (new): time-ordered random — combines timestamp ordering of v1 with privacy of v4, ideal for database primary keys as it maintains insertion order. Our generator creates v4 UUIDs.
How to generate a UUID in Python? ▼
import uuid; print(uuid.uuid4()) — generates a random UUID v4. For v1: uuid.uuid1(). For UUID from a name (v5): uuid.uuid5(uuid.NAMESPACE_URL, "https://example.com").
What is GUID vs UUID? ▼
GUID (Globally Unique Identifier) is Microsoft's name for the same concept. GUIDs are UUIDs in all but name — same format, same generation algorithms. The term GUID is common in Windows/.NET environments; UUID is used in Linux, web and database contexts. They are interchangeable.
Can two UUID v4 values ever be the same? ▼
Theoretically yes, but practically impossible. With 2¹²² possible values (~5.3 × 10³⁶), if you generated 1 billion UUIDs per second for 100 years, the probability of any collision is approximately 1 in 10¹⁵ — effectively zero for any real-world use case.