UUID Generator Online

Cryptographically random. Most widely used.

What Is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit identifier standardized by RFC 4122. It is always 36 characters long — 32 hex digits split into 5 groups by hyphens. One digit encodes the version and another the variant:

xxxxxxxx8 digits
-
xxxx4 digits
-
MxxxVersion (M)
-
NxxxVariant (N)
-
xxxxxxxxxxxx12 digits
MVersion digit — tells you which UUID type it is (1, 4, 5, or 7)NVariant bits — always 8, 9, a, or b in standard UUIDs

This tool supports all four major UUID versions: v1 (time-based), v4 (random), v5 (name-based), and v7 (Unix timestamp sortable).

UUID Versions Explained

🕐

UUID v1 — Time-Based

Encodes the current timestamp plus a random node ID. The creation time is baked into the first three groups of the UUID.

Best for: Systems where you want rough time-ordering or need to trace when an ID was created.

Output6ba7b810-9dad-11d1-80b4-00c04fd430c8
Third group starts with 1 — that's the version digit
🎲

UUID v4 — Random

Fully random — 122 bits of cryptographic randomness from the Web Crypto API. The most common UUID version. Collision probability: 1 in 2122.

Best for: Database keys, session tokens, API IDs — the default choice for most developers.

Output550e8400-e29b-41d4-a716-446655440000
Third group starts with 4 — all other digits are completely random
🔗

UUID v5 — Name-Based (SHA-1)

Deterministic — given the same namespace and name, the output UUID is always identical. It hashes the namespace + name with SHA-1.

Best for: Deduplication, or when you need a stable ID for a known resource like a domain or URL.

NSDNS
Nameexample.com
Outputcfbff0d1-9375-5685-98e9-e4b2be7d4d59
Same inputs → always produces this exact UUID

UUID v7 — Unix Timestamp (RFC 9562)

Embeds a Unix millisecond timestamp in the first 12 hex characters. UUIDs generated later are always larger, so they sort naturally by time.

Best for: Database primary keys in PostgreSQL / MySQL — keeps index pages ordered and reduces fragmentation.

Output018e3a1c-2b4f-7d3a-9f1e-2b3c4d5e6f70
First 12 chars = timestamp  ·  7 = version digit  ·  rest = random

Which UUID Version Should You Use?

🗄️ Database Primary Key

Use v7 for sequential index efficiency in PostgreSQL and MySQL, or v4 for simplicity when sort order doesn't matter.

🔑 Session & Token IDs

Use v4 for session tokens, CSRF tokens, API keys, and idempotency keys where strong randomness is the priority.

🌐 URL / Domain Identifiers

Use v5 with the URL or DNS namespace to generate stable, reproducible UUIDs for known resources — same input always gives the same ID.

📡 Distributed Tracing

Use v7 or v1 to attach time-encoded trace IDs to API requests, making it easy to correlate events across microservices by time.

📁 File & Asset Naming

Use v4 for upload filenames and cache keys. Use v5 to derive consistent IDs from known filenames or content hashes.

🔄 Deduplication

Use v5 when you want to detect duplicates: hashing the same content with the same namespace always produces the same UUID, so duplicates are automatically identified.

How to Use the UUID Generator

1
Choose a VersionClick V1, V4, V5, or V7 to select the UUID version that fits your use case.
2
Configure (v5 only)For v5, select a namespace (DNS, URL, OID, or custom) and enter a name string. The same inputs always produce the same UUID.
3
Set Count & GenerateEnter how many UUIDs you need (1–100) and click Generate. Results appear instantly with a version badge on each.
4
Copy or DownloadClick the copy icon for a single UUID, use Copy All for a newline-separated list, or hit ↓ Download to save as a .txt file.

Key Features

🔀

All 4 UUID Versions

Generate v1 (time), v4 (random), v5 (name-based SHA-1), and v7 (Unix timestamp) — all in one tool with instant switching.

📦

Batch Generation

Generate up to 100 UUIDs at once. Copy all with a single click or download as a .txt file for bulk use.

🔒

100% Client-Side

All UUID generation runs in your browser using the Web Crypto API. No data is ever sent to any server — fully private.

Frequently Asked Questions

What is the difference between UUID v1, v4, v5, and v7?

v1 encodes the current timestamp and a random node — good for time-traceable IDs but leaks generation time. v4 is fully random (122 random bits) — the most common choice. v5 is deterministic: SHA-1 hash of a namespace + name — the same inputs always produce the same UUID. v7 is a modern RFC 9562 format with a Unix millisecond timestamp prefix — ideal for database index performance.

When should I use UUID v7 over v4?

Use v7 when UUIDs are used as database primary keys. Because v7 embeds a millisecond timestamp in the high bits, rows inserted in order produce monotonically increasing UUIDs. This dramatically reduces B-tree index fragmentation in PostgreSQL, MySQL, and SQLite compared to random v4 UUIDs.

What is UUID v5 and when is it useful?

UUID v5 generates a deterministic identifier from a namespace UUID and a name string using a SHA-1 hash. Example: hashing the DNS namespace with example.com always produces cfbff0d1-9375-5685-98e9-e4b2be7d4d59. This makes v5 ideal for deduplication — if the same resource appears twice, it gets the same ID automatically.

How unique is a UUID v4?

Extremely unique. With 122 random bits, you would need to generate roughly 2.71 quintillion (2.71 × 1018) UUIDs to reach a 50% probability of even a single collision. For all practical purposes, collisions are effectively impossible.

What is the difference between UUID and GUID?

They are the same thing. GUID (Globally Unique Identifier) is Microsoft's term used in Windows and .NET. UUID is the standard term defined in RFC 4122. Structurally identical — 128-bit, same hyphenated format.

Can I use UUID as a database primary key?

Yes. For random access patterns, v4 works well in PostgreSQL (uuid column type) and MongoDB. For insert-heavy workloads where index locality matters, prefer v7 — its timestamp prefix keeps new rows near the end of the index, avoiding page splits and improving write throughput.