UUID Generator - Generate UUID v4 Online

How to Use the UUID Generator

Set how many UUIDs you need (1 to 100) using the counter, then click Generate UUID v4. Each UUID appears in a list with individual copy buttons. Use the Copy All button to copy all generated UUIDs at once, formatted one per line for easy pasting into code, databases, or spreadsheets.

What Is a UUID

A UUID (Universally Unique Identifier) is a 128-bit identifier that is guaranteed to be unique without requiring a central coordinating authority. UUIDs are formatted as 32 hexadecimal characters displayed in five groups separated by hyphens: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx.

UUID version 4, which this tool generates, uses cryptographically secure random numbers for all bits except the version and variant indicators. This makes v4 the simplest and most widely used UUID version since it requires no input data like MAC addresses, timestamps, or namespaces.

UUID Versions Compared

VersionGeneration MethodUse Case
v1Timestamp + MAC addressTime-ordered IDs (privacy concern)
v3MD5 hash of namespace + nameDeterministic IDs from strings
v4Random numbersGeneral-purpose unique IDs
v5SHA-1 hash of namespace + nameDeterministic IDs (more secure than v3)
v7Timestamp + random (new)Time-sortable random IDs

Collision Probability

The probability of generating duplicate UUID v4 values is astronomically low. With 122 random bits, there are approximately 5.3 x 10^36 possible UUIDs. Even generating 1 billion UUIDs per second for 100 years would produce a collision probability of roughly 50%. For any real-world application, UUID v4 collisions are not a practical concern.

Using UUIDs in Software Development

Database Primary Keys

UUIDs are increasingly used as database primary keys instead of auto-incrementing integers. They can be generated on the client side without querying the database, support distributed systems where multiple servers create records simultaneously, and do not expose information about record count or creation order.

The tradeoff is that UUIDs are larger than integers (16 bytes vs. 4-8 bytes) and produce less efficient B-tree indexes due to their random distribution. UUID v7 addresses the indexing issue by incorporating a timestamp prefix that provides natural ordering.

API Identifiers

Public-facing APIs typically use UUIDs instead of sequential integers for resource identifiers. Sequential IDs are problematic because they leak information (users can guess other resource IDs by incrementing) and are vulnerable to enumeration attacks. UUIDs are unguessable and do not reveal system internals.

Session Tokens and Correlation IDs

UUIDs serve as session identifiers, request correlation IDs for distributed tracing, and idempotency keys for preventing duplicate API operations. Their guaranteed uniqueness makes them reliable for any scenario where two identifiers must never collide.

Cryptographic Security

This tool generates UUIDs using the Web Crypto API (crypto.getRandomValues()), which provides cryptographically secure random numbers. This is the same randomness source used for encryption keys and security tokens, making these UUIDs suitable for security-sensitive applications.

For generating hash values from text rather than random identifiers, use the Hash Generator. For creating QR codes that encode UUIDs or other identifiers, the QR Code Generator produces scannable images.

Frequently Asked Questions

What is the difference between UUID and GUID?

UUID (Universally Unique Identifier) and GUID (Globally Unique Identifier) are the same thing. UUID is the standard term used in RFC 4122, while GUID is Microsoft's terminology. Both refer to a 128-bit identifier formatted as 32 hex digits separated by hyphens.

Can two UUIDs ever be the same?

Theoretically yes, but practically no. UUID v4 has 122 random bits, producing 5.3 undecillion possible values. You would need to generate about 2.7 quintillion UUIDs to have a 50% chance of a single collision. For all practical purposes, every UUID v4 is unique.

Should I use UUID or auto-increment for database primary keys?

UUIDs are better for distributed systems, microservices, and client-side ID generation because they do not require a central authority. Auto-increment integers are more efficient for storage and indexing in single-database systems. Choose based on your architecture.

What does each section of a UUID mean?

A UUID v4 like 550e8400-e29b-41d4-a716-446655440000 has five sections separated by hyphens in the 8-4-4-4-12 format. In v4, most bits are random except the version indicator (the '4' in the third section) and the variant indicator (bits in the fourth section).