UUID Generator
Generate cryptographically random UUID v4 identifiers instantly — single or bulk. All generated in your browser.
Frequently Asked Questions
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx — 32 hex digits split into 5 groups by hyphens. Version 4 UUIDs are randomly generated (122 random bits), giving a collision probability so low it is considered practically impossible.bigint auto-increment as the physical primary key and expose the UUID as a separate unique column for external references.00000000-0000-0000-0000-000000000000. It is defined in RFC 4122 as a sentinel value — it is guaranteed never to be generated as a real identifier. It is used in code to represent "no UUID" or an unset/null UUID value, similar to how null or 0 might be used for other types. Some languages have a corresponding max UUID (ffffffff-ffff-ffff-ffff-ffffffffffff, all bits set to 1) defined in RFC 9562, used as another sentinel value.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (8-4-4-4-12 characters). For UUID v4: the version nibble is the 13th character (always 4), and the variant bits are in the 17th character (always 8, 9, a, or b). The remaining 122 bits are random. Example: f47ac10b-58cc-4372-a567-0e02b2c3d479 — the highlighted characters show the fixed version and variant bits.crypto.randomUUID() (Web Crypto API, available in all modern browsers and Node 15+). PHP (Laravel): Str::uuid() or \Ramsey\Uuid\Uuid::uuid4()->toString(). Python: import uuid; str(uuid.uuid4()). Go: github.com/google/uuid package — uuid.New().String(). Java: UUID.randomUUID().toString(). C# (.NET): Guid.NewGuid().ToString(). Ruby: SecureRandom.uuid. All of these use a cryptographically secure random number generator to produce v4 UUIDs.About This UUID Generator
This free UUID generator creates version 4 (random) UUIDs using the Web Crypto API directly in your browser. Generate one or multiple UUIDs at once — no data is sent to a server.
Version 4 UUIDs are 128-bit random identifiers with extremely low collision probability, making them suitable for database primary keys, distributed system identifiers, file names, and any scenario requiring a globally unique ID without central coordination.
When to use this tool
- Generating unique IDs for new database records
- Creating idempotency keys for API requests
- Producing unique file or object storage names
- Testing UUID-based systems with known random values
Standards & References
How UUID v4 Generation Works
A UUID v4 is 128 bits of data, structured according to RFC 4122, with 122 bits of cryptographic randomness.
Generate Random Bits
The browser's crypto.randomUUID() (or crypto.getRandomValues() fallback) generates 128 bits of CSPRNG data from the operating system's entropy pool.
Set Version & Variant Bits
Bits 48–51 are set to 0100 (version 4). Bits 64–65 are set to 10 (RFC 4122 variant). These 6 deterministic bits identify this as a valid v4 UUID.
Format as Hyphenated Hex
The 128 bits are hex-encoded and split into 5 groups: 8-4-4-4-12 characters. The 4th group always starts with 4 and the 5th starts with 8, 9, a, or b.
Common Use Cases
Database Primary Keys
UUIDs are ideal primary keys in distributed databases where multiple nodes insert records simultaneously. Unlike auto-increment integers, they require no coordination to guarantee uniqueness across shards.
Microservice Request IDs
Pass a UUID as a X-Request-ID or correlation ID header to trace a request across multiple services. Each service logs the same ID, making it easy to reconstruct a distributed trace.
Collision-Safe File Names
When storing user uploads, rename files to UUIDs before saving. This prevents path traversal attacks, filename collisions, and information leakage from predictable file names.
Client-Side Object Identity
In single-page apps, UUIDs are used as stable keys for UI elements (lists, forms, tabs) before they're saved to the backend — React, Vue, and Angular all benefit from stable unique keys.
Configuration & Plugin IDs
Plugins, extensions, and configuration blocks in multi-tenant SaaS apps use UUIDs to identify instances uniquely across tenants without relying on sequential integers that could be guessed.
Batch ID Generation
Use the count selector to generate up to 100 UUIDs at once for seeding test databases, pre-allocating IDs, or bulk-generating identifiers for an import script.
Related Developer Tools
Related Articles
View all articles
UUID Primary Keys in PostgreSQL, MySQL, and MongoDB: Performance Differences and Implementation Patterns
PostgreSQL stores UUIDs as 16-byte native types with no performance penalty. MySQL's InnoDB clustered index makes random UUID v4 fragmentation far worse than in PostgreSQL. MongoDB's ObjectId is 12 bytes with an embedded timestamp. Here's how UUID primary keys actually behave in each database and the ORM patterns to use them correctly.
Beyond UUID: How Twitter's Snowflake IDs, ULID, CUID2, and Nano ID Work
Twitter, Discord, and Instagram all built custom ID systems because UUID couldn't handle time-sortability, distributed generation, and 64-bit constraints simultaneously. Here's how Snowflake IDs work, what ULID and CUID2 offer, and when each alternative makes sense.
UUID v1, v4, v5, v7 Compared — Which Version Should You Actually Use?
UUID v1, v3, v4, v5, and v7 all work differently and suit different use cases. Here's when to use each — including why v7 is now the recommended choice for database primary keys.
UUID Generator — Generate Unique Identifiers for Any Application
Learn what UUIDs are, the differences between versions 1, 4, and 7, when to use UUIDs over auto-increment integers, and how to generate them instantly with a free UUID generator.