All tools
Developer tools

UUID Generator

Generate cryptographically secure UUID v4 identifiers — one at a time or up to 50 in a single click.

550e8400-e29b-41d4-a716-446655440000
Version 4 · Random CSPRNG · random_bytes() 1–50 per request
Get started free Sign in

Free · No credit card · 50 credits/day

Anatomy of a UUID v4

128 bits, 32 hex characters, 5 groups — two of which carry version and variant flags.

550e8400-e29b-41d4-a716-446655440000
8 hex chars
Random bits (32)
4 hex chars
Random bits (16)
"4" prefix
Version 4 marker
3 hex chars
Random bits (12)
"a"–"b" prefix
Variant bits (RFC 4122)
2 hex chars
Random bits (14)
12 hex chars
Random bits (48)

122 of the 128 bits are random — the remaining 6 encode the version (4) and variant (RFC 4122).

UUID versions compared

v4 is the right choice for most applications — here's why.

Version Method Sortable Privacy Use when
v1 Time + MAC address ✗ Leaks MAC Legacy systems only
v3 MD5 name-based Deterministic IDs from a namespace + name (legacy)
v4 ★ Random (CSPRNG) General purpose — most common choice
v5 SHA-1 name-based Deterministic IDs from a namespace + name
v7 Time-ordered random DB primary keys (no fragmentation) — emerging standard

Where to use UUIDs

🗄️

Database primary keys

Generate IDs client-side before inserting — no round-trip to the DB needed. Works across distributed systems without a central sequence.

🔗

API resource identifiers

Expose UUIDs in REST URLs instead of sequential integers — prevents enumeration attacks and decouples external IDs from internal auto-increment keys.

📁

File and upload naming

Rename user-uploaded files to a UUID to avoid path traversal, conflicts and directory disclosure of original filenames.

🔐

Session and token IDs

Use UUIDs for session identifiers, invite tokens, password reset links and one-time codes — large random space makes brute-force infeasible.

📊

Event and log correlation

Attach a UUID to every request or event at the entry point. Propagate it through microservices to correlate all log entries for a single operation.

🧪

Test data generation

Generate unique IDs for fixtures and seed data without conflicts — especially useful when seeding across multiple environments simultaneously.

Frequently asked questions

What is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit identifier formatted as 32 hexadecimal characters in five groups separated by hyphens: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. They are designed to be globally unique without a central coordinator.

What is the difference between UUID v4 and other versions?

UUID v1 is time-based and includes the MAC address — a privacy risk. UUID v3 and v5 are name-based (MD5 and SHA-1) and deterministic. UUID v4 is randomly generated using a CSPRNG and the most widely used version — no embedded metadata and collisions are astronomically unlikely.

How unique is a UUID v4?

A UUID v4 has 122 random bits. The probability of a collision among 1 billion UUIDs generated per second for 100 years is roughly 50% — meaning in any realistic application, duplicates are negligible.

Should I use UUIDs as database primary keys?

UUIDs work well when you need client-side ID generation, cross-system uniqueness, or want to avoid exposing sequential integers. The trade-off is B-tree index fragmentation (random inserts) and 16 bytes vs 4–8 for integers. UUID v7 (time-ordered) solves fragmentation but is not yet widely supported.

Related developer tools

More tools for tokens, identifiers and encoding.

JWT Encoder

Create signed HS256 JWT tokens with custom payloads and TTL.

JWT Decoder

Decode and inspect JWT headers, payloads and expiry without the secret.

Hash Generator

Generate MD5, SHA-256 and SHA-512 hashes from any text.

Generate UUIDs now

Free account. 50 credits per day. Access to 75+ tools instantly.

Create free account →