UUID Generator

Generate random UUIDs instantly. Create RFC 4122 compliant universally unique identifiers for databases, APIs, and distributed systems

UUID Count

0

Version

v4

Status

Idle

Generated Time

--:--

Generator Options

RFC 4122 compliant random UUID generation

Generate between 1 and 500 UUIDs at once

Quick Presets

Common UUID generation presets for different use cases

Generated UUIDs

uuid-output.txt
Click "Generate UUIDs" to create random UUIDs

Export

No UUIDs generated yet

Generate UUIDs to see exportable output

Validation Checklist

UUID version selected
Valid quantity specified
UUIDs generated successfully
RFC 4122 format validated
No duplicates detected
Output is ready to copy

What is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit identifier standard defined by RFC 4122 that is designed to be unique across both space and time without requiring central registration or coordination. UUIDs are represented as 36-character strings in the format 8-4-4-4-12, such as 550e8400-e29b-41d4-a716-446655440000. The hyphens separate the string into five groups that represent the time_low, time_mid, time_hi_and_version, clock_seq, and node fields of the UUID structure.

UUIDs are widely used in software development as primary keys in databases, unique identifiers for API resources, session tokens, correlation IDs in distributed tracing, file names for uploaded content, and anywhere a system needs a unique identifier that can be generated independently without checking a central authority. Unlike auto-incrementing integers, UUIDs can be generated on any node in a distributed system without coordination, making them ideal for microservices architectures and offline-capable applications.

The term UUID is defined by IETF RFC 4122, while GUID (Globally Unique Identifier) is Microsoft's implementation of the same standard. The terms are used interchangeably in practice. Both refer to the same 128-bit identifier format and are functionally identical. This UUID generator produces RFC 4122 compliant identifiers using cryptographically secure randomness.

How Does UUID Version 4 Generation Work?

UUID version 4 is entirely based on random numbers. Here is exactly how a v4 UUID is constructed:

  1. Generate 16 Random Bytes: The generator creates 16 bytes (128 bits) of cryptographically random data using the browser's crypto.getRandomValues() API, which provides high-quality randomness suitable for security-sensitive applications.
  2. Set Version Bits: The 4 most significant bits of the 7th byte (byte index 6) are set to 0100 to indicate version 4. This changes the value of this byte to be in the range 0x40 to 0x4F.
  3. Set Variant Bits: The 2 most significant bits of the 9th byte (byte index 8) are set to 10 to indicate the RFC 4122 variant. This changes the value of this byte to be in the range 0x80 to 0xBF.
  4. Convert to Hex String: The 16 bytes are converted to a 32-character hexadecimal string. Hyphens are inserted at positions 8, 13, 18, and 23 to create the standard 8-4-4-4-12 format.
  5. Output the UUID: The final 36-character string is returned, e.g., f47ac10b-58cc-4372-a567-0e02b2c3d479.

After setting the version and variant bits, 122 bits remain random. This gives UUID v4 a total of 2^122 (approximately 5.3 × 10^36) possible values. The theoretical probability of a collision — even when generating a billion UUIDs per second for a billion years — remains vanishingly small. This is why UUID v4 is considered "practically unique" for all real-world applications.

Benefits of Using UUIDs

No Central Coordination

UUIDs can be generated independently on any system without needing a central authority, database, or network call. This makes them perfect for distributed systems, microservices, and offline-first applications.

Unpredictable

Unlike sequential IDs, random UUIDs cannot be guessed or enumerated. This prevents attackers from guessing resource URLs, order numbers, or user IDs by incrementing values, improving security.

Database Compatibility

UUIDs are natively supported by all major databases — PostgreSQL, MySQL, SQL Server, MongoDB, Redis, and others. They can be stored as CHAR(36), UUID native types, or binary(16) for space efficiency.

Merge-Friendly

When merging data from different sources or databases, UUIDs eliminate ID conflicts entirely. Each record already has a globally unique identifier, so merging is seamless without ID remapping.

Privacy Protection

Sequential integer IDs expose business information like user signup order, daily transaction volume, and growth rate. UUIDs hide this information since they are random and non-sequential.

API Standard

UUIDs are the de facto standard for resource identifiers in REST APIs, GraphQL, and webhook systems. Using UUIDs from the start avoids costly migrations later when your API needs to scale.

How to Use This UUID Generator

  1. Select Version: Choose UUID version 4 (random) from the dropdown. This is the most commonly used version and is suitable for virtually all use cases.
  2. Set Quantity: Use the slider or type a number (1–500) to specify how many UUIDs you want to generate at once. For a single UUID, leave it at 1.
  3. Choose Format: Select your preferred output format — standard lowercase with dashes, uppercase, no dashes (compact), or wrapped in curly braces. The standard format is recommended for most uses.
  4. Generate: Click the "Generate UUIDs" button. The UUIDs will appear instantly in the output panel with zero network latency since all generation happens in your browser.
  5. Review Output: Check the list view for a clean, line-by-line display, or switch to the raw view for a plain text representation. Each UUID is validated for RFC 4122 compliance.
  6. Check Validation: The checklist confirms the version is selected, quantity is valid, UUIDs are generated, format is RFC 4122 compliant, no duplicates exist, and output is ready.
  7. Copy or Download: Click "Copy" to copy all UUIDs to your clipboard (one per line), or "Download" to save them as a .txt file. Each UUID is on its own line for easy parsing.
  8. Use Presets: For common tasks, click a preset button — "Single UUID", "Batch of 10", "Batch of 50", or "Uppercase" — to auto-configure and generate instantly.

Practical Use Cases for UUIDs

  • Database Primary Keys: Use UUIDs as primary keys in distributed databases where auto-incrementing integers would require coordination across shards or services. PostgreSQL's native UUID type, MySQL's CHAR(36), and MongoDB's ObjectId alternatives all support UUIDs.
  • REST API Resource IDs: Expose UUIDs as resource identifiers in URLs (e.g., /api/users/550e8400-e29b-41d4-a716-446655440000) to prevent enumeration attacks and allow ID generation at the client side.
  • Distributed Tracing: Generate UUIDs as trace IDs and span IDs in distributed tracing systems (OpenTelemetry, Jaeger, Zipkin) to correlate requests across multiple microservices.
  • Session Tokens: Create secure, unpredictable session identifiers for web applications. UUID v4's 122 bits of randomness exceeds the minimum entropy requirements for session tokens.
  • File Naming: Use UUIDs as file names for user-uploaded content to prevent collisions and filename conflicts. The randomness also prevents enumeration of uploaded files.
  • Message Queue Correlation: Attach UUIDs to messages in message queues (RabbitMQ, Kafka, SQS) for correlation, deduplication, and exactly-once processing patterns.
  • Feature Flags: Use UUIDs to uniquely identify feature flags, experiments, and configuration entries in feature management systems where identifiers must be globally unique across environments.
  • Offline-First Applications: Generate UUIDs locally in mobile or desktop apps that work offline, then sync to the server when connectivity is restored without ID conflicts.

Frequently Asked Questions

Explore More Tools

Once you have generated your UUIDs, try these related developer tools:

Share This Tool

Found this useful? Share it with your development community.