UUID Generator
Generate v1, v4, v5, and v7 UUIDs instantly — 100% client-side.
Random — cryptographically random, most widely used
Format
About UUID Versions
UUID v1 — Timestamp
Encodes the current time and MAC address. Useful when you need to trace when a UUID was created, but exposes your machine identity.
UUID v4 — Random
Cryptographically random — the most widely used version for database primary keys, session tokens, and any scenario where uniqueness is the only requirement.
UUID v5 — Namespace+Name
Deterministic SHA-1 hash of a namespace and a name string. The same inputs always produce the same UUID — ideal for stable identifiers derived from known values.
UUID v7 — Sortable Timestamp
RFC 9562 millisecond-precision timestamp in the high bits, random in the low bits. Lexicographically sortable — excellent for database indexes and event ordering.
How to Generate a UUID
- 1Pick a version. Choose v4 if you just need a unique random ID. Choose v7 if you're inserting into a database and want the IDs to sort by creation time. Use v5 if you need a stable ID derived from a known value like a URL or domain name.
- 2Set format options (optional). Toggle hyphens off for compact storage, uppercase for SQL conventions, or add braces for Windows COM/registry usage.
- 3Generate one or many. Hit Generate for a single UUID, or enter a count (up to 1000) and click Generate Bulk. Click any UUID to copy it, or use Copy All for bulk results.
- 4Download if needed. Bulk results can be saved as a .txt file (one UUID per line) for use in seed scripts, test fixtures, or data migrations.
UUID vs GUID — What's the Difference?
Nothing practical. UUID (Universally Unique Identifier) is the open standard defined by RFC 4122. GUID (Globally Unique Identifier) is Microsoft's name for the same concept — same 128-bit format, same structure, fully interchangeable. You'll see GUID in .NET, SQL Server, and Windows APIs; UUID everywhere else. This tool generates both.
One minor difference: Windows GUIDs are often displayed with braces — {550e8400-e29b-41d4-a716-446655440000}. Toggle the Braces format option above to generate in that style.
Which UUID Version Should You Use?
| Version | Use when… |
|---|---|
| v4 | You need a random, globally unique ID and order doesn't matter. Default choice for database PKs, API keys, and session tokens in most apps. |
| v7 | You're inserting into a B-tree index (Postgres, MySQL, SQLite) and want sequential IDs to avoid index fragmentation. UUID v7 sorts correctly by time, making it a drop-in replacement for auto-increment in distributed systems. |
| v5 | You need the same UUID for the same input every time — e.g., content-addressable storage, deduplication keys, or mapping external IDs to UUIDs deterministically. |
| v1 | Legacy systems that specifically require v1. Note: v1 embeds your MAC address, which can be a privacy concern. Prefer v7 for new timestamp-based use cases. |
Frequently Asked Questions
Are these UUIDs truly unique?
UUID v4 uses 122 bits of randomness. The probability of generating the same UUID twice is astronomically small — roughly 1 in 5.3 × 10³⁶. For all practical purposes, yes. UUID v5 is deterministic, so the same inputs always yield the same UUID by design.
Is it safe to generate UUIDs in the browser?
Yes. This tool uses crypto.randomUUID() and crypto.getRandomValues() — the same cryptographically secure APIs your browser uses for HTTPS. Nothing is sent to any server.
Can I use UUID v4 as a database primary key?
Yes, and many apps do. The main trade-off is index performance: random UUIDs cause B-tree fragmentation at scale. If you're on Postgres or MySQL and inserting millions of rows, UUID v7 gives you the same global uniqueness with sequential ordering — better for indexes.
What is UUID v7 and why is it better than v1?
UUID v7 (RFC 9562, 2024) encodes a Unix millisecond timestamp in the most significant bits, followed by random data. This makes UUIDs sortable by creation time without exposing any hardware identifiers. It's the modern replacement for v1 in any system that needs time-ordered IDs.
How do I generate UUIDs without hyphens?
Click the Hyphens toggle in the Format Options section to turn it off. The output will be 32 hex characters with no separators — useful for storage formats that don't support hyphens or for URL-safe identifiers.