Skip to content
GeneratorsWorks offlineNew

UUID Generator

Generate UUID v4 and time-ordered v7 identifiers in bulk.

Your result will appear here.

122 random bits. The usual choice when order does not matter.

A UUID is a 128-bit identifier that can be generated anywhere, by anyone, without coordinating with a central authority — and still be effectively certain not to collide with anyone else’s. This generator produces both the familiar random v4 and the newer time-ordered v7, using your browser’s cryptographic randomness.

v4 or v7?

Both are 128 bits and both are unique in practice. The difference is whether they sort.

  • v4 — 122 random bits. No structure, no information leaked, no ordering. The right default when a UUID is just an identifier.
  • v7 — a 48-bit millisecond timestamp followed by random bits. Values sort by creation time, which matters a great deal if they are database keys.

Why v7 exists

Databases store primary keys in a sorted structure. Inserting random v4 values writes to a different part of that index each time, so pages are constantly split and the working set grows until it no longer fits in memory. On a large table this shows up as insert performance degrading over months.

A v7 sorts by time, so new rows land next to each other and inserts stay at the end of the index. If you are choosing a UUID for a primary key today, v7 is usually the better choice.

The trade-off is that a v7 reveals roughly when it was created. Where that matters — a public identifier that should not disclose signup timing — v4 remains the right answer.

Are collisions really impossible?

Not impossible, just negligible. With 122 random bits, you would need to generate around a billion UUIDs per second for roughly 85 years before the chance of a single collision reached even 50%.

That guarantee depends entirely on the randomness being good. This tool uses the browser’s cryptographic generator; identifiers built on Math.random offer nothing like the same assurance.

FAQ

Are these UUIDs generated on a server?

No. They are produced locally by your browser’s cryptographic random number generator. Nothing is transmitted or logged, and nobody — including us — ever sees the values you generate.

Should I use a UUID as a database primary key?

It is a reasonable choice when identifiers must be generated by clients or merged across systems. Prefer v7 so inserts stay ordered. If you only ever generate keys in one database and never expose them, an auto-incrementing integer is smaller and faster.

What is the difference between UUID and GUID?

None of substance. GUID is Microsoft’s name for the same 128-bit identifier. They are interchangeable, though Microsoft tooling often displays them in uppercase and wrapped in braces.

Can I remove the hyphens?

Yes, with the hyphens toggle. The hyphens are purely conventional formatting, so a 32-character UUID is the same value and converts back without loss.

Related tools