Skip to content
ENExplore Calculators

UUID Generator

Generate RFC 4122 version 4 UUIDs locally, with collision-probability maths for your volume.

About UUID Generator

A version 4 UUID is 128 bits, of which 122 are random: four bits encode the version and two encode the RFC 4122 variant. That leaves an identifier space of 2^122 ≈ 5.3 × 10^36 values, which is why v4 UUIDs can be generated independently on many machines without coordination. The chance that any two collide follows the birthday approximation, p ≈ n² / (2 × 2^122) for n identifiers, so even at a billion IDs the probability stays around 10^-19 — far below the failure rate of the hardware storing them. Generation here happens entirely in your browser using WebCrypto, so no identifier is ever transmitted.

Formulas

Collision probability (birthday approximation)

p ≈ n² / (2 × 2^122)

n
Total number of UUIDs generated over the system's lifetime
2^{122}
Size of the v4 random space (122 random bits)

Canonical v4 layout

xxxxxxxx-xxxx-4xxx-Nxxx-xxxxxxxxxxxx where N ∈ {8, 9, a, b}

4
Version nibble, fixed to 4
N
Variant nibble, top two bits fixed to binary 10

Worked example

With the default values below, UUID Generator returns First UUID of bc005246-2f8e-4f5b-95f3-dc6e1c1ec489. Change any input above and every figure here is recalculated in your browser.

Inputs used

How many UUIDsaccepts 1–100
5
Formatone of Lowercase with hyphens (canonical), Uppercase with hyphens, Lowercase, no hyphens, Braced {…}
Lowercase with hyphens (canonical)
Expected total IDs generatedminimum 1
1,000,000

Results

First UUID
bc005246-2f8e-4f5b-95f3-dc6e1c1ec489
Random Bits per UUID
122
Collision Probability at Your Volume
9.404 × 10⁻²⁶
Entropy Source
WebCrypto getRandomValues (cryptographically strong)

Step by step

  1. 1Random bits per v4 UUID= 122 bits
  2. 2Size of the identifier space= 5.317e+36
  3. 3Collision probability at your volume= 9.404e-26

Assumptions and limits

  • The result is derived only from the 3 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 3 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

Are these UUIDs safe to use as database primary keys?

Yes for uniqueness, but consider the storage and index-locality cost: a random v4 UUID scatters inserts across a B-tree index, which is why time-ordered variants such as UUIDv7 or ULID are often preferred for high-insert-rate tables.

Can I use a v4 UUID as a security token or password reset key?

Only when it comes from a cryptographically strong source, which this tool reports. 122 random bits is ample entropy, but many UUID libraries historically used weak PRNGs, so verify the generator rather than assuming the format implies strength.

Why is the version character always 4?

RFC 4122 reserves the first nibble of the third group for the version number, so a version 4 (random) UUID always shows a literal 4 there. The first character of the fourth group is the variant and is always 8, 9, a or b.

How likely is a collision in practice?

At one billion UUIDs the probability is roughly 10^-19. You would need to generate about 2.7 × 10^18 UUIDs before reaching a 50% chance of a single collision.

UUID Generator – Calculate Generated UUIDs & First UUID