UUID Generator
Generate random UUID v4 identifiers in bulk
31205587-3fbe-46e7-9908-24a43f711811 What is UUID?
A UUID (Universally Unique Identifier) is a 128-bit label used to identify information in computer systems without requiring a central coordinating authority. UUIDs are fundamental to distributed computing because they allow independent systems — different servers, microservices, client applications, or even offline devices — to each generate identifiers that are guaranteed to be unique without any coordination or shared state.
The UUID specification (originally RFC 4122, updated by RFC 9562 in 2024) defines several versions, each with a different generation strategy. Version 1 uses the host MAC address and timestamp, version 4 uses cryptographically secure random numbers, and the newer version 7 combines a Unix timestamp with random data for sortability. Version 4 is by far the most commonly used in web development because it requires no special hardware or clock synchronization — just a good random number generator.
UUIDs are represented as 32 hexadecimal digits displayed in five groups separated by hyphens: 8-4-4-4-12 (e.g., 550e8400-e29b-41d4-a716-446655440000). The 13th hex digit indicates the version (4 for random), and the 17th hex digit indicates the variant (8, 9, a, or b for the RFC 4122 variant). Despite containing 128 bits, the version and variant fields are fixed, leaving 122 bits of randomness in a v4 UUID.
How it works
UUID v4 generation is conceptually simple: fill 128 bits with cryptographically secure random data, then set the version and variant bits to their fixed values. The version field (bits 48-51) is set to 0100 (decimal 4), and the variant field (bits 64-65) is set to 10. This leaves exactly 122 bits of entropy, producing 5.3 x 10^36 possible unique values — enough that generating a billion UUIDs per second for 85 years would give only a 50% chance of a single duplicate.
In modern browsers, the crypto.randomUUID() API handles this entire process natively. It uses the operating system cryptographically secure pseudorandom number generator (CSPRNG) — /dev/urandom on Linux, CryptGenRandom on Windows, or SecRandomCopyBytes on macOS — ensuring the random bits are suitable for security-sensitive applications, not just uniqueness.
The canonical string format converts each of the 16 bytes to two hexadecimal characters and inserts hyphens at byte boundaries 4, 6, 8, and 10. The tool offers options to strip hyphens (producing a compact 32-character string useful for filenames or database fields without separator overhead) and to output in uppercase or lowercase depending on your codebase conventions.
How to use this tool
- Click the "Generate" button to create a single UUID v4. The result appears immediately and can be copied with one click.
- To generate multiple UUIDs at once, set the quantity using the bulk count input (up to 100) and click generate. All UUIDs are displayed in a list with individual copy buttons.
- Toggle the "Dashes" option off if you need compact 32-character UUIDs without hyphen separators, useful for database fields or URL slugs.
- Toggle the "Uppercase" option if your project convention uses uppercase hex characters (e.g., 550E8400-E29B-41D4-A716-446655440000).
- Use the "Copy All" button to copy the entire list to your clipboard at once, with each UUID on a separate line — useful for pasting into seed data files or migration scripts.
Examples
Generating test IDs for API development
When building a REST API that uses UUIDs as resource identifiers, generate a handful of v4 UUIDs to use as test data in your request payloads, mock responses, and integration tests. Having consistent test UUIDs makes debugging easier since you can search logs by identifier.
Creating seed data for a database migration
Bulk generate 50 UUIDs for use as primary keys in a database seed file. Copy all values at once and paste them into your SQL INSERT statements or JSON seed data, ensuring each record has a properly formatted unique identifier without writing a generation script.
Generating a correlation ID for distributed tracing
In microservice architectures, a single user request may traverse multiple services. Generate a UUID to use as a correlation ID that gets passed in HTTP headers (typically X-Request-ID or X-Correlation-ID) across service boundaries, allowing you to trace the full request lifecycle through aggregated logs.
Creating unique filenames for uploads
When handling user file uploads, use a UUID (with dashes stripped) as the stored filename to avoid collisions and prevent information leakage from the original filename. For example, a photo might be stored as 550e8400e29b41d4a716446655440000.jpg rather than john_passport_scan.jpg.
About this tool
Generate one or many UUID v4 identifiers using the native crypto.randomUUID() API. Bulk generate up to 100 UUIDs at once, toggle uppercase/lowercase and dashes, and copy individual or all values.
Common use cases
- • Generating unique identifiers for database records, test data, or mock objects
- • Creating UUIDs for distributed systems where sequential IDs would cause conflicts
- • Bulk generating UUIDs for seed data or migration scripts
- • Getting properly formatted UUIDs without writing code or using the command line
Frequently asked questions
- What is a UUID v4?
- UUID v4 (Universally Unique Identifier version 4) is a 128-bit identifier generated using random numbers. It has the format xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx, where "4" indicates version 4 and "y" is one of 8, 9, a, or b. The probability of generating a duplicate is astronomically low.
- Are these UUIDs truly random?
- Yes. The tool uses the browser's crypto.randomUUID() API, which is backed by a cryptographically secure random number generator (CSPRNG). These UUIDs are suitable for security-sensitive applications.
- What is the difference between a UUID and a GUID?
- UUID (Universally Unique Identifier) and GUID (Globally Unique Identifier) refer to the same thing. "UUID" is the standard term used in RFC 4122, while "GUID" is the term commonly used in Microsoft ecosystems.
- How many UUIDs can I generate before getting a collision?
- UUID v4 has 122 random bits, yielding 5.3 x 10^36 possible values. You would need to generate approximately 2.71 x 10^18 (2.71 quintillion) UUIDs to have a 50% chance of a single collision. For practical purposes, collisions in properly generated v4 UUIDs do not happen.
- Should I use UUIDs as database primary keys?
- UUIDs work well as primary keys in distributed systems where multiple nodes create records independently. The trade-off is that random UUIDs cause B-tree index fragmentation in traditional databases, leading to slower inserts. Consider UUID v7 (time-ordered) or ULID for sortable alternatives, or use a sequential integer primary key with a UUID as a secondary public-facing identifier.
- What is the difference between UUID v4 and UUID v7?
- UUID v4 is purely random, while UUID v7 (defined in RFC 9562, May 2024) embeds a Unix timestamp in the first 48 bits followed by random data. This makes v7 UUIDs lexicographically sortable by creation time, solving the database index fragmentation problem while still being globally unique. This tool generates v4 UUIDs using the standard browser API.