Pixab AI
Files never leave your browserInstant processing100% free, no signupWorks offline after first load

UUID Generator

Generate UUID v1, v4, and v7 identifiers in your browser. Bulk generate up to 1,000 UUIDs, choose formats, and download as a text file.

Cryptographically random — the most widely used version.

max 1,000

How it works

  1. 1Select the UUID version: v1 (time-based), v4 (random), or v7 (time-sortable).
  2. 2Choose a format: standard, UPPERCASE, no hyphens, or with braces.
  3. 3Set the quantity (1 to 1,000) and click Generate.
  4. 4Copy the first UUID, copy all, or download as a .txt file.

Frequently asked questions

What Is a UUID?

A UUID (Universally Unique Identifier), also known as a GUID (Globally Unique Identifier) in Microsoft contexts, is a 128-bit label used to uniquely identify information in computer systems. UUIDs are standardized by RFC 4122 and formatted as 32 hexadecimal digits displayed in five groups separated by hyphens: 550e8400-e29b-41d4-a716-446655440000. The format is described as 8-4-4-4-12 for the number of hex digits in each group.

The primary purpose of a UUID is to generate identifiers that are unique across space and time without requiring a central authority or coordination between systems. Unlike auto-increment integer IDs that require a database to issue the next sequential value, UUIDs can be generated independently on any machine and still be unique — or at least unique enough for practical purposes. This makes them indispensable in distributed systems, microservices, and offline- first applications.

UUID v1 vs v4 vs v7 — Key Differences

The UUID specification defines multiple versions, each using a different strategy to ensure uniqueness. The most practically important are v1, v4, and the newer v7.

UUID v1 (time-based). v1 UUIDs embed the current timestamp at 100-nanosecond precision and the MAC address of the generating machine. This guarantees uniqueness across time and across machines. The downside is privacy: the MAC address reveals which machine generated the UUID, and the timestamp reveals when. v1 is also sequential within a single machine, which can be useful or problematic depending on the use case. Modern implementations often replace the MAC address with a random node to avoid privacy concerns.

UUID v4 (random). v4 UUIDs are entirely random — 122 bits of cryptographically random data (the remaining 6 bits encode the version and variant). This is by far the most commonly used version. v4 UUIDs are not sequential, reveal no information about when or where they were generated, and have an astronomically low collision probability. The probability of generating the same v4 UUID twice is approximately 1 in 5.3 × 10²¹ for the first collision when generating a billion UUIDs per second for 85 years.

UUID v7 (time-sortable, new). UUID v7 is a newer standard (RFC 9562) that combines the best of v1 and v4: the first 48 bits encode the Unix timestamp in milliseconds, making v7 UUIDs lexicographically sortable by creation time, while the remaining bits are random. This makes v7 UUIDs ideal for database primary keys — they sort in creation order (like auto-increment integers), but can be generated without central coordination (unlike auto-increment). v7 is becoming the recommended UUID version for new systems.

UUIDs as Database Primary Keys

Using UUIDs as database primary keys is a common and often debated architectural choice. The main advantages are: keys can be generated client-side before the database insert, enabling optimistic concurrency and offline-first patterns; keys are globally unique across tables, databases, and services, simplifying data merging and replication; and keys do not expose row counts or insertion order to end users.

The traditional disadvantage of UUID v4 primary keys is poor database index performance. B-tree indexes (used by PostgreSQL, MySQL, and most databases) work best with sequential keys because insertions at the end of the index are efficient. Random UUID v4 keys cause random index insertions, leading to index fragmentation and slower write performance at scale. UUID v7 solves this problem: because v7 UUIDs are ordered by creation time, they behave like auto-increment keys from the database's perspective while retaining all the distribution benefits of UUIDs.

UUID Collision Probability

The collision probability of UUID v4 is so low that it can be treated as impossible in practice. The 122 random bits give a key space of 2¹²² ≈ 5.3 × 10³⁶ possible values. To have a 50% chance of collision (the birthday paradox), you would need to generate approximately 2.7 × 10¹⁸ UUIDs — that is 2.7 quintillion. At a rate of one billion UUIDs per second, it would take over 85 years to reach that threshold.

In real-world applications generating millions or even billions of UUIDs, the probability of a collision is vanishingly small — orders of magnitude smaller than hardware failures or software bugs. UUID v4 collision probability is not a practical concern.

UUID in Software Development

UUIDs appear in virtually every modern software system. In web APIs, UUIDs serve as resource identifiers in REST URLs: /users/550e8400-e29b-41d4-a716-446655440000. This prevents clients from guessing or enumerating resource IDs, unlike sequential integers.

In event-driven systems and message queues, UUIDs identify messages and events for deduplication and idempotency — the server can check if it has already processed a message with a given UUID and skip it if so. In distributed tracing (OpenTelemetry, Jaeger), UUID- based trace IDs link log entries and spans across multiple services.

File systems and operating systems use UUIDs to identify disk partitions, hardware devices, and file system volumes. When you run blkid on Linux or check Disk Management on Windows, you see UUID-like identifiers for each partition. The Hash Generator is useful alongside UUID generation when you need to hash UUIDs for lookups.

Frequently Asked Questions

What is the difference between UUID and GUID?

UUID (Universally Unique Identifier) and GUID (Globally Unique Identifier) are the same concept. GUID is the Microsoft term used in COM, Windows APIs, and .NET. UUID is the IETF term used in open standards. Both refer to 128-bit identifiers formatted as xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.

Is UUID v4 truly random?

v4 UUIDs use 122 random bits (6 bits are version/variant indicators). This tool uses crypto.getRandomValues(), which is the browser's cryptographically secure random number generator — the same RNG used for encryption keys. The randomness is cryptographically strong, not pseudo-random.

Can I use UUIDs as primary keys in MySQL?

Yes, but use UUID v7 instead of v4 for performance. Random UUIDs (v4) cause index fragmentation in InnoDB. v7 UUIDs are ordered by creation time, giving you efficient sequential index insertions. Alternatively, use UUID_TO_BIN(uuid, 1) in MySQL 8.0+ to store UUIDs efficiently as BINARY(16) with time-ordering.

How do I generate a UUID in my programming language?

Node.js: crypto.randomUUID() (v15.6+). Python: import uuid; uuid.uuid4(). Go: use the github.com/google/uuid package. Java: UUID.randomUUID(). PostgreSQL: gen_random_uuid() or enable the uuid-ossp extension.

What does “no hyphens” format mean?

Some systems store or transmit UUIDs without the hyphen separators as a 32-character hex string, e.g., 550e8400e29b41d4a716446655440000. This is the same UUID — just formatted differently. The standard representation with hyphens is preferred for readability.

Are UUIDs case-sensitive?

No. UUID hex digits can be uppercase or lowercase — they represent the same value. 550E8400-E29B-41D4-A716-446655440000 and 550e8400-e29b-41d4-a716-446655440000 are identical. By convention, UUIDs are typically displayed in lowercase.

When should I use v7 instead of v4?

Use UUID v7 when the UUIDs will be used as database primary keys or in any context where lexicographic sorting by creation order matters. Use v4 everywhere else — it is simpler, more widely supported, and the randomness guarantees are identical. v7 is the future-facing recommendation for new systems, especially those using UUIDs as database keys.

Keep going