# Free Online UUID Generator (v4 and v7)

> Generate UUID v4 and v7 identifiers in your browser. v7 is time-ordered for database keys, v4 is pure random. RFC 9562, free online.

Canonical: https://stayslocal.app/dev/uuid-generator
Last updated: 2026-08-16

A UUID is 128 bits written as 36 characters, unique enough that separate systems can mint one without asking anyone. Which version you pick matters more than most people expect, because it decides whether your primary key helps the database or fights it.

## RFC 9562: v4 versus v7

RFC 9562 replaced RFC 4122 in 2024 and added the time-ordered versions. v4 is 122 random bits, so consecutive inserts land in random positions of a B-tree index — pages split, the cache hit rate falls and a large table gets slower to write. v7 puts a 48-bit Unix millisecond timestamp in the high bits and fills the rest with randomness, so generated ids sort roughly in creation order and inserts stay at the right-hand edge of the index. Both are generated here from the browser's crypto.getRandomValues, the platform's cryptographic random source.

Fields:
- Layout: 8-4-4-4-12 lowercase hex characters. 36 characters with the hyphens, 32 without.
- Version nibble: First character of the third group: 4 for v4, 7 for v7. That is how you identify a UUID you have been handed.
- Variant bits: Top bits of the fourth group, which is why that character is always 8, 9, a or b in both versions.
- v7 timestamp: The leading 48 bits are milliseconds since the Unix epoch, so a v7 id leaks its creation time to anyone who reads it.
- Randomness: crypto.getRandomValues, not Math.random. 122 random bits in v4 make a collision negligible at any realistic volume.

## How to generate a UUID online

1. Choose v4 or v7 — v7 for anything stored as a database key; v4 when order must reveal nothing.
2. Set how many — Generate one, or a batch for seed data and fixtures.
3. Copy them out — Hyphenated or bare hex, whichever your schema expects.

## Where a UUID is the right key

- Primary keys a client can mint offline, before the row ever reaches the server.
- Correlation ids threaded through logs across several services.
- Idempotency keys so a retried payment request cannot charge twice.
- Filenames or object keys that will not collide across parallel uploads.

## Questions

**Should I use v7 for everything?**

No. v7 embeds a millisecond timestamp, so it tells anyone holding the id when the record was created and roughly how many you create per second. For a public, guessable-order-sensitive identifier — a password reset token, a share link — use v4.

**Are these generated on a server?**

No. They come from crypto.getRandomValues in this browser tab. Nothing is requested, nothing is logged, and the generator keeps working offline.

**Can two UUIDs ever be the same?**

In principle yes, in practice no for v4 at any volume a normal system reaches. The risk that matters is a weak random source, not the maths — which is why this uses the platform's cryptographic generator rather than Math.random.

**Why is v4 bad for database keys?**

Because the bits are random, each insert targets an arbitrary page of the index. That causes page splits and a working set too large to cache. v7's timestamp prefix keeps inserts sequential, which is the whole reason it was standardised.

## Related

- [Password Generator](https://stayslocal.app/dev/password-generator): Random passwords and EFF passphrases
- [Developer Tools](https://stayslocal.app/dev): every tool in this family
