UUID Generator
Free online UUID v4 generator. Create unique random identifiers instantly. Copy single or bulk UUIDs with one click.
About UUID v4
UUID v4 uses random numbers. Collisions are extraordinarily unlikely, which makes it practical for database primary keys, session tokens, and unique identifiers.
What is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit label used for information in computer systems. The term GUID (Globally Unique Identifier) is also used, particularly in Microsoft systems. UUIDs are standardized by the Open Software Foundation (OSF) as part of the Distributed Computing Environment (DCE).
A UUID looks like: 550e8400-e29b-41d4-a716-446655440000
UUID Versions Explained
There are five versions of UUIDs, each generated differently. Version 4, which this tool generates, is the most commonly used:
- UUID v1 — Based on timestamp and MAC address. Sortable but can expose hardware information.
- UUID v2 — DCE Security UUIDs, rarely used in practice.
- UUID v3 — Name-based using MD5 hashing. Deterministic but uses outdated MD5.
- UUID v4 — Randomly generated. Most widely used for general purposes.
- UUID v5 — Name-based using SHA-1 hashing. Preferred over v3 when determinism is needed.
Common Uses for UUIDs
- Database primary keys — Replace auto-incrementing integers for distributed systems where multiple databases need unique keys without coordination.
- Session tokens — Secure, non-guessable session identifiers for web applications.
- File naming — Guarantee uniqueness when storing uploaded files to avoid name collisions.
- API keys — As the basis for generating unique API access tokens.
- Distributed systems — Any scenario where unique IDs must be generated across multiple systems without a central coordinator.
UUID Format Details
UUID vs. ULID vs. NanoID
| Identifier | Length | Sortable | Best For |
|---|---|---|---|
| UUID v4 | 36 chars (with hyphens) | No | General purpose unique IDs |
| UUID v7 | 36 chars | Yes (time-ordered) | Database indexes that benefit from sorting |
| ULID | 26 chars | Yes | Time-ordered IDs in distributed systems |
| NanoID | 21 chars (default) | No | Shorter URLs, where brevity matters |
| CUID2 | 24 chars | No | Fingerprint-safe, collision-resistant IDs |
Collision probability: If you generated 1 billion UUIDs every second for 100 years, the probability of a single duplicate would be about 50%. In practice, UUIDs are still safe to treat as unique for real-world applications because typical volumes are vastly smaller.
Frequently Asked Questions
Are UUIDs truly unique?
UUID v4 is based on random numbers, making it statistically unique but not mathematically guaranteed. The probability of collision is approximately 1 in 2^122. In practice, UUID v4 is safe to treat as globally unique for any real-world application.
Should I use UUID as a database primary key?
UUID v4 works well as a primary key for distributed systems, but comes with trade-offs. The random nature fragments database indexes, potentially slowing INSERT performance on large tables. If you need UUID as a primary key, consider UUID v7 (time-ordered) or ULID for better index performance.
What is the difference between UUID and GUID?
UUID and GUID refer to the same concept — a 128-bit universally unique identifier. GUID is Microsoft's terminology used in Windows and .NET. UUID is the open standard term defined by RFC 4122. They are compatible and interchangeable.
Is UUID safe to expose in URLs?
Yes — UUID v4 characters (0-9 and a-f) are all URL-safe. Whether to expose UUIDs in URLs depends on your security model. If the UUID is a secret access token, avoid putting it in logged URLs. If it's just an identifier with server-side authorization checks, URL exposure is fine.