🆔 UUID Generator
Generate universally unique identifiers using your browser’s cryptographic random number generator — the values never leave your machine. Version 4 is random; version 7 is time-ordered, which indexes far better as a database primary key.
What each version puts in the 128 bits
Both versions start from 16 bytes of crypto.getRandomValues, the
browser's cryptographic generator. Six bits are then overwritten to declare the
version and the RFC 4122 variant, which is why the 13th hex digit is always 4 or
7 and the 17th is 8, 9, a or b:
v4 xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx 122 random bits
v7 tttttttt-tttt-7xxx-yxxx-xxxxxxxxxxxx 48-bit ms timestamp
+ 74 random bits
A v7 made on 8 September 2026 begins 01a07e50-... - that prefix is
just Date.now() in hex, so v7 values sort by creation time as text
and stay compact in a B-tree index. Uniqueness rests entirely on the randomness:
nothing is registered, no MAC address or serial number is involved, and no two
machines coordinate.
Options and limits
- Count is clamped to 1-1000. A blank or negative box becomes 1 and anything larger becomes 1000; the field is rewritten to the value used.
- Uppercase, braces and no-hyphens are cosmetic. The 32 hex
digits are unchanged, so
{550E8400...}is the same identifier as the lowercase dashed form. - Nil UUID is the all-zero constant, useful as a placeholder that is guaranteed never to be a real generated value.
Frequently asked questions
How likely is a duplicate UUID v4?
With 122 random bits you would need about 103 trillion of them before there was even a one in a billion chance of a single collision. The real risk is a weak random source, not the maths - which is why this page uses the browser's crypto API rather than Math.random.
Should I use UUID v4 or v7 for a database key?
v7, in most cases. Random v4 keys scatter inserts across the whole index and fragment it; v7 keys arrive in roughly ascending order, so new rows land at the end of the B-tree. Use v4 where the identifier is public and its creation time should stay private.
Are these UUIDs generated on your server?
No. They are produced in your browser and never sent anywhere, so a batch you copy has been seen only by your own machine.