UUID Generator
Generate v4 random UUIDs (universally unique identifiers). Single or bulk, cryptographically secure.
What is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit number used to identify resources in computer systems. The UUID standard (RFC 4122) was designed so that any system, anywhere in the world, can generate a UUID without coordination and have practically zero chance of producing the same one as anyone else. UUIDs replaced legacy auto-incrementing integer IDs in distributed systems because they work across multiple databases, can be generated client-side, don't reveal information about your data (like row counts to attackers), and don't conflict when merging data from different sources. UUID v4 (the random variant) is the most common - this generator produces v4 UUIDs using the cryptographically secure crypto.getRandomValues() API for true uniqueness.
How to use this tool
- Choose how many UUIDs — 1 to 1,000 in one batch. Bulk generation is useful for database seeding, test data creation.
- Pick format — Standard (lowercase with hyphens), Uppercase, No hyphens (32 hex chars), or With braces (Microsoft GUID format).
- Click Generate — New random UUIDs appear in the output box. Click Generate again to get a different set.
- Copy or download — Copy button puts all UUIDs on clipboard. Or click any individual line to select and copy.
UUID v4 structure
Standard format: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx (36 characters total)
- 32 hex characters (0-9, a-f) plus 4 hyphens
- The '4' at position 13 marks this as a v4 (random) UUID
- The 'y' at position 17 is one of 8, 9, a, or b (variant indicator per RFC 4122)
- The other 30 hex characters are randomly generated (122 bits of randomness)
Total possible v4 UUIDs: 2^122 = ~5.3 × 10^36. Probability of generating the same UUID twice with 1 billion UUIDs is ~2.7 × 10^-18 - effectively zero.
This generator uses crypto.getRandomValues() which is cryptographically secure - true random, not predictable.
Examples
- Standard: a3f8c19d-6b87-4f6c-9a4d-3c8e1d9f7b2e
- Uppercase: A3F8C19D-6B87-4F6C-9A4D-3C8E1D9F7B2E
- No hyphens: a3f8c19d6b874f6c9a4d3c8e1d9f7b2e
- With braces (Microsoft): {a3f8c19d-6b87-4f6c-9a4d-3c8e1d9f7b2e}
Tips & best practices
- Use UUIDs as primary keys when: distributed systems, client-generated IDs, security-sensitive (hide row counts), high-collision-risk merging
- Stick with auto-increment integers when: single-database system, performance-critical (UUIDs use more storage and slower indexes), human-readable IDs needed
- For URLs, use UUIDs to obscure database structure (don't expose /user/123, use /user/uuid)
- Database column type: most modern DBs have native UUID type (PostgreSQL uuid, SQL Server uniqueidentifier) - use those over CHAR(36) for performance
- Hyphenated UUIDs are 36 chars in DB, no-hyphen is 32. Many ORMs handle both formats
- Don't use UUIDs as session tokens directly - generate cryptographic tokens for sessions, not UUIDs
Limitations & notes
UUID v4 uses random numbers - while collision probability is astronomically small, it's not strictly zero. For absolute uniqueness (database constraints), still use UNIQUE constraints. UUIDs are larger than integer IDs (16 bytes vs 4-8) - storage and index size are larger. Sorting UUIDs doesn't preserve creation order - if you need chronological IDs, use UUID v7 (time-based, newer standard) or ULID instead.
Frequently Asked Questions
Are UUIDs really unique?
Practically, yes. The probability of generating two identical v4 UUIDs is ~2.7 x 10^-18 with one billion UUIDs - lower than the chance of being struck by lightning twice. For all practical purposes, treat them as unique. Database UNIQUE constraints add safety net.
What's the difference between UUID v1 and v4?
v1 uses timestamp + MAC address - sequential but leaks creation time and machine identity. v4 uses pure random - unpredictable, no information leak, most popular. v3/v5 are name-based (MD5/SHA-1 hash of input). v7 (new) is sortable timestamp + random - best of both worlds for new systems.
When should I use UUID vs auto-increment ID?
UUID when: distributed systems, multiple databases, client-generated IDs, want to hide row counts (security), merging data from different sources. Integer when: single database, performance critical (faster indexes), need human-readable URLs, embedded systems with low storage.
Are UUIDs case-sensitive?
The UUID itself is hexadecimal so technically case-insensitive (A = a). However, most systems store and compare lowercase by convention. Stick with lowercase for consistency. Some legacy Windows/.NET tools default to uppercase {GUID} format.
Can I use UUIDs in URLs?
Yes - very common pattern. /users/a3f8c19d-6b87-4f6c-9a4d-3c8e1d9f7b2e is preferable to /users/123 for security (no enumeration of users) and works in distributed systems. Some sites use shorter URL-safe alternatives like nanoid or shortuuid.
How many UUIDs can I safely generate?
Until the heat death of the universe. To have 50% chance of one collision, you'd need to generate ~2^61 UUIDs (2.3 quintillion). At 1 billion UUIDs per second, this would take 73 years - and you'd have to store and check all of them.
What is GUID? Same as UUID?
GUID (Globally Unique Identifier) is Microsoft's term for UUID - they're identical. Microsoft just used a different name. Both refer to the same RFC 4122 standard. GUIDs are often displayed with {curly braces}, UUIDs without.
Related tools
Password Generator · Hash Generator · Random Number Generator
