Skip to content

UUID Generator

Random v4 or time-sortable v7, in bulk.

  • Files stay on your device
  • No upload, no waiting
  • No sign-up, no watermark
All generators

Questions

What is the difference between UUID v4 and v7?

A v4 UUID is 122 random bits. A v7 UUID replaces the top 48 bits with a millisecond timestamp, so v7 identifiers sort chronologically while v4 ones do not. v7 was standardised in RFC 9562 in 2024; v4 dates back to RFC 4122 in 2005. The trade-off is that v7 reveals when it was created, to the millisecond.

Which version should I use for a database primary key?

v7, in most cases. Random v4 keys scatter inserts across a B-tree index, which fragments it, ruins cache locality and can badly slow bulk inserts on a large table. v7 keys start with a timestamp so new rows append to the end of the index the way an auto-incrementing integer would, while keeping the decentralised generation that made you want a UUID in the first place.

Can two UUIDs ever collide?

In theory yes, in practice no. A v4 UUID has about 5.3 × 10^36 possibilities, and reaching a 50% chance of one collision would take roughly 2.7 × 10^18 of them — about 85,000 years at a million per second. The genuine real-world risk is not the maths but weak randomness; this tool uses crypto.randomUUID and crypto.getRandomValues, the browser's cryptographically secure source.

Should UUIDs be uppercase or lowercase?

Lowercase with hyphens is the canonical form, and RFC 9562 requires generators to output it, even though parsers must accept either case. Uppercase turns up in Microsoft and .NET tooling; the hyphenless 32-character form is common in URLs and filenames. Both are available here, but pick one and be consistent — the forms are not equal as strings.

How many can I generate at once?

Up to 500 per batch, copyable as a block or downloadable as a text file. Generation is instant and happens entirely in your browser, so nothing is sent to a server and there is no rate limit or account to worry about.

About uuid generator

What a UUID is

A UUID is a 128-bit identifier written as 32 hexadecimal digits in five hyphen-separated groups. Its purpose is to let independent systems generate identifiers that will not collide without ever coordinating with each other — no central sequence, no database round trip, no lock.

v4 versus v7

v4v7
Content122 random bits48-bit timestamp + 74 random bits
SortableNoYes — chronologically
Leaks creation timeNoYes, to the millisecond
Good as a database keyPoorGood
StandardisedRFC 4122 (2005)RFC 9562 (2024)

The database point is the one that catches people out. A v4 UUID is random, so consecutive inserts land in random places in a B-tree index. That fragments the index, wrecks cache locality and can slow bulk inserts dramatically on a large table. A v7 UUID starts with a timestamp, so new rows append to the end of the index the way an auto-incrementing integer would — while keeping the decentralised generation that made you want a UUID in the first place. If you are choosing a primary key type today, v7 is usually the better answer.

The trade-off is that v7 embeds the creation time in plain sight. If your identifiers are public and the timing is sensitive — when an account was created, when a document was drafted — that may be a leak you do not want. Use v4 there.

Are collisions actually possible?

Technically yes, practically no. A v4 UUID has 122 random bits, giving about 5.3 × 10³⁶ possibilities. To reach a 50% chance of a single collision you would need to generate roughly 2.7 × 10¹⁸ of them. At a million UUIDs per second it would take on the order of 85,000 years. You will hit every other scaling limit in your system long before you hit this one.

The real-world caveat is the quality of the randomness, not the maths. UUIDs generated by a weak or poorly seeded source have collided in practice. This tool uses crypto.randomUUID and crypto.getRandomValues, the browser’s cryptographically secure source.

Formatting

The canonical form is lowercase with hyphens, and that is what you should store and compare against — RFC 9562 requires generators to output lowercase, even though parsers must accept either case. Uppercase turns up in Microsoft tooling and the .NET ecosystem. Hyphenless 32-character form is common where an identifier has to go into a URL path or a filename. Both options are here, but pick one and be consistent, because the two forms are not equal as strings.

Related

Browse the rest of the generators, or make a strong secret with the password generator.