How to Generate UUIDs
- Select how many UUIDs you need (1, 5, 10, 25, 50, or 100).
- Click Generate — a new batch is created instantly.
- Click any UUID row to copy it, or use Copy all to copy the full list as newline-separated text.
- Toggle UPPERCASE if your target system requires uppercase hex.
- Click Generate again at any time to produce a fresh batch.
What Is a UUID?
A UUID (Universally Unique Identifier) — also called a GUID (Globally Unique Identifier) in Microsoft contexts — is a 128-bit label standardized in RFC 4122 and displayed as 32 hexadecimal digits in five groups:
UUID v4 sets the version nibble to 4 and two variant bits to 10; the remaining 122 bits are filled with random data. This gives approximately 5.3 × 10³⁶ possible values — enough that collisions are negligible in any practical system.
UUID Versions Compared
| Version | Basis | Best for | Trade-offs |
|---|---|---|---|
| v1 | Time + MAC | Audit logs, Cassandra | Leaks machine identity + timestamp |
| v3 | MD5 hash | Deterministic IDs from names | MD5 is not collision-resistant |
| v4 | Random | General purpose, DB keys | No natural sort order (index fragmentation) |
| v5 | SHA-1 hash | Deterministic IDs from names | SHA-1 is weak; prefer SHA-256 alternatives |
| v7 | Time-ordered random | High-write DB keys | Not yet in all languages/frameworks |
Using UUIDs as Database Primary Keys
UUID v4 primary keys have two well-known drawbacks in relational databases: random insertion order causes B-tree index fragmentation in PostgreSQL and MySQL, and a 16-byte UUID is larger than a 4-byte integer primary key.
For most applications these trade-offs are acceptable. When you need both global uniqueness and sequential ordering — for example, high-write PostgreSQL tables — consider UUID v7 or ULID, which are time-ordered and reduce index fragmentation while remaining unique across distributed systems.
Frequently Asked Questions
What is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit label displayed as 32 hex digits in five groups: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. UUID v4 uses 122 random bits, giving approximately 5.3 × 10³⁶ possible values — enough to make collisions negligible in any real system.
What is the difference between UUID and GUID?
They are the same thing. GUID (Globally Unique Identifier) is Microsoft's name for the UUID standard. Both follow RFC 4122 and use the same format. The term GUID is common in Windows, .NET, and SQL Server; UUID is used everywhere else.
Can two UUIDs be the same?
Theoretically yes, but practically no. UUID v4 has 122 random bits. You would need to generate 1 billion UUIDs per second for 85 years to reach a 50% probability of a single collision. For any real-world use — databases, tokens, IDs — collisions are not a practical concern.
Is crypto.randomUUID() safe?
Yes. crypto.randomUUID() is part of the Web Crypto API and uses the operating system's CSPRNG (Cryptographically Secure Pseudorandom Number Generator). It is available in all modern browsers (Chrome 92+, Firefox 95+, Safari 15.4+) and Node.js 14.17+. Never use Math.random() for UUIDs — it is not cryptographically secure.
When should I use UUID v7 instead of v4?
Use UUID v7 when you need both global uniqueness and time-ordered IDs — for example, as primary keys in high-write PostgreSQL or MySQL tables where random insertion order would fragment B-tree indexes. UUID v4 is still the simpler, widely-supported default for most applications.
Is my data sent to a server?
No. UUID generation uses your browser's built-in crypto.randomUUID() function entirely client-side. No network request is made. Open DevTools → Network tab and confirm — nothing is sent when you click Generate.