Developer

Encoders, converters & dev utilities

12 tools
Developer · UUID Generator

UUID v4 Generator — Random UUIDs (RFC 9562)

A version-4 UUID is a 128-bit identifier built almost entirely from random data: 122 random bits plus 6 fixed bits that mark the version and variant. In canonical text it is 36 characters in the 8-4-4-4-12 hex layout, e.g. f47ac10b-58cc-4372-a567-0e02b2c3d479. Two positions are always fixed: the 13th hex digit is 4 (the version), and the 17th is one of 8, 9, a or b (the variant). v4 is the right choice when you want an opaque, unguessable identifier — random tokens, correlation IDs, idempotency keys — where sort order does not matter. This generator uses the browser's crypto.randomUUID() (a CSPRNG), never Math.random(), so the output is cryptographically random and generated entirely in your browser. Need time-ordered keys for a database instead? See UUID v7. Free, no login.

Quick answer

v4 = 122 random bits + fixed version/variant bits, 128 bits total (RFC 9562)

  • Canonical form: 8-4-4-4-12 hex = 36 characters including hyphens
  • Version nibble: the 13th hex digit is always 4
  • Variant nibble: the 17th hex digit is 8, 9, a or b (the 10xx variant)
  • Example: f47ac10b-58cc-4372-a567-0e02b2c3d479 (note the 4 and the a in those positions)
  • Generated with crypto.randomUUID() — a CSPRNG — never Math.random()
  • Uniqueness is astronomically likely but not guaranteed; use v4 for opaque random IDs, v7 for DB keys
Open the full UUID Generator

Frequently asked questions

What is a UUID v4?

A UUID version 4 is a 128-bit identifier that is mostly random: 122 random bits plus fixed bits that encode the version (4) and variant. It is written as 36 characters in the 8-4-4-4-12 hex pattern, for example f47ac10b-58cc-4372-a567-0e02b2c3d479. You can recognise a v4 by the digit 4 in the 13th position and one of 8/9/a/b in the 17th. It is the most common UUID version and the default when you just need a random, opaque identifier.

Are UUID v4 values guaranteed to be unique?

Not guaranteed, but the collision probability is astronomically small. With 122 random bits, you would need to generate on the order of a billion UUIDs per second for about 85 years to reach a 50% chance of a single collision. In practice v4 is treated as effectively unique for application IDs. The important caveat is that this relies on a good random source — this tool uses the browser CSPRNG (crypto.randomUUID()); using Math.random() instead would weaken the guarantee.

When should I use v4 instead of v7?

Use v4 when you want an opaque, unguessable identifier and do not care about ordering — random API tokens, correlation IDs, idempotency keys, or public-facing IDs where leaking creation time would be undesirable. Use v7 when the ID is a database primary key or you want values that sort in creation order, because v7 embeds a timestamp and keeps B-tree index inserts sequential. If in doubt for a new database key, prefer v7; for a random token, v4.

Related UUID Generator pages