UUID generator
UUID v4 is a 128-bit random identifier formatted as 8-4-4-4-12 hex (e.g. 550e8400-e29b-41d4-a716-446655440000). Use for database primary keys, correlation IDs, and filename uniqueness without a central allocator. Generated locally with crypto.getRandomValues when available.
How to generate UUIDs
1. Click generate (or generate multiple if supported).
2. Copy UUID to clipboard.
3. Paste into API request, SQL insert, or config.
4. Store lowercase consistently if your DB is case-sensitive.
UUID use cases
Database primary key
Insert user with id UUID instead of sequential int — safe for public APIs without enumeration.
Request correlation ID
Add X-Request-ID header with fresh UUID per HTTP call for distributed tracing logs.
S3 object key prefix
uploads/{uuid}/photo.jpg avoids filename collisions in shared buckets.
When UUID v4 fits
• When IDs must be unique across distributed systems without coordination.
• When exposing IDs publicly — random UUIDs resist guessing.
• When merging data from offline clients without ID conflicts.
Version nibble
Character after third hyphen block indicates version — 4 means random UUID. Validates format quickly in code reviews.
Frequently asked questions
UUID v4 vs v1?
v4 is random; v1 includes timestamp and MAC-derived node — v4 preferred for privacy.
Collision probability?
Astronomically low for practical purposes — birthday paradox irrelevant at app scale.
Uppercase or lowercase?
RFC allows both — pick one convention per project; Postgres uuid type normalizes.
Hyphens required?
Standard format includes hyphens; some systems accept 32 hex chars without.
Cryptographically secure?
Uses browser CSPRNG when available — not Math.random.