All tools

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.
Output
a2444bd2-3c89-410d-8aa0-2ba103a37761

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.

When not to use UUID v4

When sequential human-readable order matters (invoice numbers) — use sequences.
When index fragmentation on random UUID PK hurts DB perf at huge scale — consider UUID v7 or ULID.
When compact URL slugs needed — use short ids or nanoid.

Version nibble

Character after third hyphen block indicates version — 4 means random UUID. Validates format quickly in code reviews.

Database indexing

Random UUIDs cause B-tree page splits vs sequential ints — acceptable until billions of rows; monitor insert perf.

UUID in URLs

Fine for private resources; combined with auth. Do not rely on UUID secrecy alone for authorization.

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.

How many can I generate?

No practical limit locally — generate one at a time or batch per UI.