How to Generate UUIDs

Universally Unique Identifiers (UUIDs) are 128-bit numbers used to uniquely identify records, sessions, transactions, and resources. They are the backbone of modern distributed systems, where generating sequential IDs across multiple servers is impractical.

What Is a UUID?

A UUID is a standardized 128-bit identifier defined by RFC 4122. It is typically displayed as 32 hexadecimal characters separated by hyphens in a 8-4-4-4-12 pattern:

550e8400-e29b-41d4-a716-446655440000

The probability of generating two identical UUIDs is so astronomically low that for practical purposes, every UUID you ever generate will be unique across all computers in the world.

UUID Versions Explained

There are several UUID versions, each designed for different use cases. The three most common are:

UUID v1 — Time-Based

Generated from the current timestamp and the MAC address (or a random node ID) of the machine. It embeds the creation time directly, making it easy to sort chronologically. However, it leaks the generating machine's identity, which is a privacy concern.

Best for: Legacy systems, debugging, and scenarios where time-based ordering matters and privacy is not a concern.

UUID v4 — Random

Generated entirely from random numbers. It contains no meaningful information about the machine or time of creation. This is the most widely used version due to its simplicity and privacy.

Best for: General-purpose unique identifiers, database primary keys, session tokens, and anything where you need a unique value with no ordering guarantee.

UUID v7 — Time-Ordered

A newer version (RFC 9562) that combines a Unix timestamp prefix with random data. The key advantage is that v7 UUIDs sort chronologically, making them ideal for database primary keys. Unlike v1, they do not expose machine identity.

Best for: Database primary keys, any system where you need both uniqueness and chronological ordering, and high-throughput distributed systems.

How to Generate UUIDs Step by Step

  1. 1Choose the UUID version. For most use cases, UUID v4 is the safe default. If you need chronological ordering (e.g., for database keys), choose v7. Use v1 only for legacy compatibility.
  2. 2Set the quantity. Need one UUID or a hundred? The generator lets you create up to 100 UUIDs in a single batch, which is useful for populating test databases.
  3. 3Click Generate.The UUIDs are created instantly in your browser using the Web Crypto API — no server round-trip required.
  4. 4Copy or download. Copy individual UUIDs with one click, or download the entire batch as a text file.

Try It: Generate UUIDs Online

Use our free, client-side UUID Generator to create v1, v4, and v7 UUIDs instantly. Your data never leaves your browser.

Open UUID Generator

Related Tools