UUIDs Generator

Generate UUID v1/v3/v4/v5 (and NIL)

Create random UUIDs, time-based UUIDs, or name-based UUIDs using a namespace and name

Last updated: January 22, 2026
Frank Zhao - Creator
CreatorFrank Zhao

Results

Results update automatically as you change settings.

Introduction / Overview

A UUID (Universally Unique Identifier) is a 128-bit identifier typically written as 32 hex characters separated by hyphens.

This UUIDs Generator helps you:

  • Create random UUIDs (v4) for database keys, API resources, and tracking IDs.
  • Create name-based UUIDs (v3/v5) that are deterministic for a given namespace + name.
  • Create time-based UUIDs (v1) for compatibility with legacy systems.

If you also need secure random strings for API keys or invite codes, pair this with Token Generator. If you want fast digests of a string, try Hash Text.

Who typically uses this?

  • Developers creating IDs for database rows and REST resources
  • Teams migrating data and needing stable cross-system identifiers
  • QA / SRE workflows that need many unique IDs quickly

A quick reliability note

UUIDs are standardized. For v4, the space of possibilities is huge because most bits are random. Roughly speaking, v4 has 21222^{122} possible values.

That doesn’t mean “impossible” collisions, but it does mean collisions are so unlikely that UUIDs are a practical choice for most applications.

How to Use / Quick Start

  1. 1
    Pick a UUID version (v4 is the common default for random IDs).
  2. 2
    Choose how many UUIDs you want to generate.
  3. 3
    For v3/v5, pick a namespace (DNS/URL preset or Custom) and enter a Name.
  4. 4
    Click Generate (or Regenerate) to produce UUIDs.
  5. 5
    Copy one UUID per row, or use Copy all if you need a batch.

Case A: how many v4 UUIDs exist?

A UUID is 128 bits, but v4 reserves some bits for the version and variant.

random bits=128\text{random bits} = 128-66==122122

So the count of possible v4 UUIDs is:

N=21225.3×1036N = 2^{122} \approx 5.3\times 10^{36}

Case B: collision intuition (birthday bound)

For v4, a simple approximation for the collision probability when generating nn UUIDs is:

pn(n1)22122p \approx \frac{n(n-1)}{2\,2^{122}}

Example: generating n=106n = 10^6 UUIDs:

pp\approx106(1061)22122\frac{10^6\,(10^6-1)}{2\,2^{122}}\approx101225.3×1036\frac{10^{12}}{2\cdot 5.3\times 10^{36}}\approx9.4×10269.4\times 10^{-26}

This is why v4 is the usual default for unique IDs.

How to interpret the output

Each generated value is a UUID string you can paste directly into code, SQL, JSON, or logs. If you chose v3/v5, the same namespace and name will always produce the same UUID.

Real-World Examples

Database primary keys (v4)

When you need an ID before writing to the database (client-side), v4 is a good default. Generate 50 IDs, then use them as primary keys for rows created offline and synced later.

Event correlation across systems (v4)

Give each event a UUID and pass it through webhooks, queues, and logs. A single identifier makes debugging easier when multiple services are involved.

Deterministic IDs for imports (v5)

If you import the same entities repeatedly, v5 lets you compute a stable UUID from a namespace + name so you don’t create duplicates. Useful for “externalId → internalId” mapping.

Legacy compatibility (v1)

Some older systems store v1. Use it only when you must, because it can leak timing information and may include node identifiers depending on implementation.

A concrete v5 input/output pattern

Name-based UUIDs are built from a namespace UUID plus a name string. Conceptually:

uuid=UUIDv5(namespace, name)\mathrm{uuid} = \mathrm{UUIDv5}(\mathrm{namespace},\ \mathrm{name})

If your namespace is “DNS” and your name is a domain like example.com\text{example.com}, the tool generates a deterministic UUID. If you run it again with the same inputs, you get the same UUID (that’s the point).

Common Scenarios

Generating IDs for APIs

Use v4 for resource IDs in REST/GraphQL APIs. Generate in bulk for fixtures or load tests.

Client-side first, sync later

Create v4 IDs offline and sync data later without waiting for an auto-increment key.

Stable IDs from external keys

Use v5 with a custom namespace to turn “vendorId:1234” into a stable UUID across imports.

Tracing distributed events

Attach a UUID to an event so you can correlate logs across webhook retries and queues.

Legacy systems requiring v1

Generate v1 only when a system explicitly requires it. Prefer v4/v5 for new designs.

Sharing a sample set

Share a link to your generated UUID list for debugging or coordination. Avoid sharing sensitive names.

When UUIDs might not be a good fit

  • If you need strictly increasing IDs for sorting (UUIDs are mostly random)
  • If your database/index size is a major constraint (UUIDs are larger than integers)
  • If you need a secret token (use a token generator instead of UUID)

Tips & Best Practices

  • Pick v4 for general-purpose unique IDs (the default in many apps).
  • Pick v5 when you need deterministic output from a namespace + name (e.g., stable imports).
  • Avoid v1 unless required; it can reveal timing info and may embed node identifiers depending on implementation.
  • Use “Copy all” for batches, but be mindful of where you paste (logs vs. production data).
  • If you enable sharing with results, remember that IDs (and names for v3/v5) can end up in the URL.

UUID vs token: a practical rule

If the value must be unguessable (security boundary), prefer a cryptographic token. UUID v4 is often fine for uniqueness, but it’s not a replacement for a secret.

For secrets, use Token Generator.

Calculation Method

UUID structure (high level)

UUIDs are 128-bit values. The standard defines how to set the version and variant bits. The remaining bits depend on the version.

UUID{0,1}128\mathrm{UUID} \in \{0,1\}^{128}

For v4, most bits are random, so:

#values=2122\#\text{values} = 2^{122}

Name-based UUIDs (v3/v5)

v3 uses MD5 and v5 uses SHA-1 to hash namespace  name\mathrm{namespace}\ \|\|\ \mathrm{name}. Then the algorithm sets the proper version/variant bits and formats the result.

uuid=f(hash(namespacename))\mathrm{uuid} = f(\mathrm{hash}(\mathrm{namespace} \|\| \mathrm{name}))

Time-based UUIDs (v1)

v1 uses a timestamp plus additional fields (like clock sequence and node identifier). It can be useful for interoperability, but may leak information.

Related Concepts

Uniqueness vs security

“Unique” means two generated values are very unlikely to match. “Secure” means an attacker can’t guess or derive the value. Many teams use UUIDs for uniqueness, and use tokens (random secrets) for security.

Indexing considerations

UUID columns are wider than integers, which can affect index size and cache efficiency. It’s usually fine, but if you’re optimizing a high-write database, you may consider UUID ordering strategies or different ID schemes.

Frequently Asked Questions

Which UUID version should I use most of the time?

For general unique IDs, v4 is the most common default. Use v5 when you need deterministic IDs from a namespace and name.

Is UUID v4 “cryptographically secure”?

UUID v4 is random in most implementations, but it is not a general-purpose secret token format. If you need an unguessable secret, use a dedicated token generator.

Why does v4 have 122 random bits instead of 128?

Because the UUID standard reserves bits for the version and variant. For v4, the number of random bits is roughly 122, giving 2^{122} possibilities. 21222^{122}

Will v5 always return the same UUID for the same inputs?

Yes. v5 is deterministic: the same namespace + name produces the same UUID every time (assuming the same algorithm and formatting rules).

Why are v1 UUIDs sometimes discouraged?

v1 can leak timing information and may encode node identifiers depending on implementation. Prefer v4 or v5 for new systems unless you need v1 for compatibility.

Can I generate multiple UUIDs at once?

Yes. Use the Quantity setting, then copy rows individually or use Copy all for a batch.

What is the NIL UUID used for?

The NIL UUID is all zeros. It’s useful as a sentinel value meaning “no ID” in some APIs and data models.

Limitations / Disclaimers

  • UUIDs help with uniqueness, but they are not a substitute for secrets.
  • v1 may leak information; use it only when necessary.
  • If you share links with results, identifiers (and v3/v5 names) can be included in the URL.

External References