Skip to content

UUID Generator

Generate secure, random UUID v4 identifiers instantly. Bulk generate up to 100 UUIDs with format options — all in your browser.

0 UUIDs

Click "Generate UUID" to start generating UUIDs

UUID Anatomy

xxxxxxxx - xxxx - 4xxx - yxxx - xxxxxxxxxxxx
Random (time-independent)
Random (clock sequence)
Version (always 4)
Variant bits (8, 9, a, or b)
Random bits

Session Stats

0 Total Generated
0 Copied

About UUID v4

UUID v4 uses 122 random bits, providing 5.3 × 1036 unique values. The probability of a collision across 1 billion UUIDs is approximately 1 in 1018.

Uses the browser's crypto.randomUUID() API for cryptographic-quality randomness.

What is a UUID?

A UUID (Universally Unique Identifier), also known as a GUID (Globally Unique Identifier), is a 128-bit identifier standardized by RFC 4122. UUIDs are represented as 32 hexadecimal digits displayed in five groups separated by hyphens: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.

UUID v4 (the most commonly used version) generates identifiers using random or pseudo-random numbers. This means no central authority is required to coordinate ID creation, and the chance of two independently generated UUIDs being identical is astronomically small — making them ideal for distributed systems.

When to Use UUIDs

  • 🗄️
    Database Primary Keys
    Use UUIDs as primary keys to avoid sequential ID enumeration attacks and to merge records from multiple databases without conflicts.
  • 🔗
    API Resources
    Expose UUID-based resource IDs in REST or GraphQL APIs instead of sequential integers to prevent data harvesting.
  • 🔒
    Session Tokens
    Generate unique session or reset tokens that are unpredictable and cannot be guessed by attackers.
  • 📁
    File Names
    Rename uploaded files to UUIDs to prevent filename collisions and avoid exposing original file names.
  • 🌐
    Distributed Systems
    Generate IDs across multiple servers or microservices without coordination — each service can create unique IDs independently.
  • 📦
    Event IDs
    Assign unique identifiers to events, messages, or transactions in event-driven architectures and message queues.

Frequently Asked Questions

What is UUID v4?

UUID version 4 (UUIDv4) is the most widely used UUID version. It is generated using 122 random bits (the other 6 bits are fixed for version and variant). This makes it statistically unique without any coordination between systems. The format is xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx where 4 indicates the version and y is one of 8, 9, a, or b.

Are UUIDs truly unique?

UUIDs are not mathematically guaranteed to be unique — they are probabilistically unique. However, the probability of a collision is so small it is effectively negligible. If you generate 1 billion UUIDs per second for 100 years, the probability of a single collision is about 50%. In practice, for any realistic usage, UUIDs are unique.

What is the difference between UUID and GUID?

UUID and GUID refer to the same concept. UUID (Universally Unique Identifier) is the IETF term defined in RFC 4122, while GUID (Globally Unique Identifier) is Microsoft's term used in Windows and COM technology. They share the same format and generation methods — the names are interchangeable.

Is UUID v4 secure enough for tokens?

UUID v4 provides 122 bits of randomness, which is sufficient entropy for most use cases. However, for security-critical tokens (password resets, session tokens), you should use a cryptographically secure random number generator. This tool uses the browser's crypto.randomUUID() API, which is cryptographically secure and suitable for security tokens.

Should I use UUIDs or auto-increment IDs for databases?

Both have trade-offs. Auto-increment IDs are smaller (4-8 bytes), faster to index, and simpler. UUIDs are larger (16 bytes), slightly slower to index, but prevent enumeration attacks, work across distributed systems, and can be generated client-side without a database round-trip. For public-facing APIs, UUIDs are generally recommended. For internal high-volume tables, auto-increment may be preferable.

What is the difference between UUID versions?

There are 8 UUID versions. v1 is time-based (embeds timestamp + MAC address). v3 and v5 are name-based (deterministic, using MD5 or SHA-1). v4 is random (most common). v6, v7, and v8 are newer drafts: v7 is time-ordered random, which is better for database indexing than v4 while retaining randomness. This generator produces v4 UUIDs.