📚 What Is a UUID?
A UUID (Universally Unique Identifier), standardized in RFC 9562, is a 128-bit value written as 32 hexadecimal digits grouped into five sections separated by hyphens: 8-4-4-4-12 characters, e.g. 550e8400-e29b-41d4-a716-446655440000. Its purpose is to be unique across systems, servers, and time without requiring any central registry or coordination — any two independently generated UUID v4s are, for all practical purposes, guaranteed never to collide.
🔢 UUID Versions Explained
| Version | Based On | Sortable? | Common Use |
| v1 | Timestamp + node/MAC identifier | Yes, chronological | Systems needing creation-order tracking |
| v4 | Cryptographically random bits | No | Database keys, API tokens, session IDs — most common choice |
| v5 | SHA-1 hash of a namespace + name | No, deterministic | Generating the same UUID reproducibly from the same input |
| v7 | Unix timestamp + random bits | Yes, chronological | Modern choice combining sortability with randomness |
This tool generates v4 (the most widely used, fully random) and v1 (timestamp-based). Read the full breakdown in our guide: UUID vs GUID Explained.
🔑 Why UUIDs Instead of Auto-Increment IDs?
- No central coordination needed: Multiple servers or services can generate IDs independently without ever needing to check with each other to avoid collisions.
- Harder to enumerate: Sequential IDs (1, 2, 3…) let anyone guess adjacent records exist. Random UUIDs give no such hint.
- Safe for merging datasets: Combining records from multiple databases without ID collisions is trivial with UUIDs, painful with auto-increment integers.
- Works offline: A client can generate a valid, permanent ID before ever syncing with a server.
⚠️ Tradeoffs to Know
💾
Storage Size
A UUID takes 16 bytes versus 4-8 bytes for an integer — meaningful at very large scale across many indexed rows.
📊
Index Locality
Random UUID v4 as a primary key can fragment B-tree indexes since inserts land in random positions rather than appending sequentially.
👀
Human Readability
Nobody can read a UUID out loud accurately or remember one — fine for machine use, poor for anything user-facing.
✅
Mitigation: UUID v7
Newer UUID v7 embeds a timestamp prefix, restoring index-friendly sequential ordering while keeping the rest random.
🛠️ Use Cases
🖥️
Database Primary Keys
Especially useful in distributed or sharded databases where independent ID generation matters more than sequential ordering.
🔑
API Keys & Session Tokens
A random, unguessable identifier is exactly what's needed for session tokens, API keys, and request-tracing IDs.
📦
File & Object Naming
Uploaded file storage systems commonly use UUIDs as filenames to guarantee no collision regardless of the original filename.
📈
Test Data Generation
Generate bulk UUIDs quickly to populate test fixtures, mock datasets, or seed scripts during development.
🔗 More Developer Tools
Convert timestamps with our Unix Timestamp Converter, or generate secure passwords with our Password Generator. Read the full guide: UUID vs GUID Explained.
What is a UUID? +
A 128-bit value (RFC 9562) written as 32 hex digits in five hyphen-separated groups, designed to be unique across systems without central coordination.
What is the difference between UUID v1 and v4? +
v1 derives from timestamp plus a node identifier, making it sortable but potentially revealing generation time. v4 is fully random, offering no ordering but stronger privacy.
How unique is a UUID v4, really? +
With 122 random bits, the collision probability among a billion UUID v4s remains astronomically small — for practical purposes they're treated as guaranteed unique.
Are UUIDs generated by this tool cryptographically secure? +
Yes — it uses crypto.getRandomValues(), a cryptographically secure random source, not Math.random().
Can I use a UUID as a database primary key? +
Yes, common especially in distributed systems. The tradeoff is larger storage (16 bytes) and potentially worse index locality versus sequential integers.
What does a nil UUID mean? +
00000000-0000-0000-0000-000000000000 — a reserved special value meaning "no UUID" or an unset identifier.
Is this UUID generator free with no limits? +
Yes — unlimited generation, individually or in bulk up to 1000 at a time, no sign-up, no rate limiting.
What is a GUID and is it different from a UUID? +
GUID (Globally Unique Identifier) is Microsoft's term for the same underlying concept — functionally equivalent to a UUID in virtually all practical contexts.
Can two different systems generate the same UUID v4 by coincidence? +
Theoretically possible but practically negligible — you'd need to generate roughly a trillion UUIDs before a 50% chance of even one collision.
Why does my UUID have specific characters like "4" and "a" in fixed positions? +
Those positions encode the UUID version and variant per the RFC 9562 spec — the "4" marks it as version 4, and the variant bits are constrained to specific values.
Is UUID v1 a privacy risk? +
It can be, since it embeds a timestamp and originally a MAC address (modern implementations use random node IDs instead) — v4 is generally preferred when no ordering is needed.
What is UUID v7 and should I use it instead? +
v7 embeds a Unix timestamp prefix followed by random bits, giving both chronological sortability and strong randomness — increasingly preferred for new systems needing both properties.
Can I generate UUIDs in bulk for testing? +
Yes — set the count field up to 1000 and download as .txt or .csv for use in test fixtures or seed scripts.
Do UUIDs expire or become invalid? +
No — a UUID is a permanent, static value with no built-in expiry. Any expiration logic must be implemented separately by your application.
Which UUID version should I use by default? +
Version 4 (random) is the safe default for most use cases — API keys, session tokens, general-purpose IDs. Reach for v1 or v7 specifically when you need chronological sortability.