UUID Generator

Version

v7 includes a timestamp for time-based ordering.

Generated on your device. Never stored.

Two versions.
One familiar format.

Generate one UUID v4 or v7 identifier in your browser, then copy it. v7 is already selected. The result is always lowercase hexadecimal with hyphens. The page does not upload it, and it does not keep a list of earlier ones.

How to generate a UUID

The version control is two radios. v7 is checked in the page, and v4 is the other choice. The line under the radios starts as “v7 includes a timestamp for time-based ordering.” The large identifier and the line under it are one button. With JavaScript running, that button is filled as soon as the script starts, using whichever radio is checked.

  1. Leave v7 selected, or choose v4. Changing the radio builds a new identifier immediately and rewrites the note. You do not have to press “Generate again” first.
  2. Click the identifier to copy it. The status under it tells you whether the copy worked.
  3. Press “Generate again” for another identifier of the same version. The previous one is replaced on screen and is not saved.

Choosing v4 sets the note to “v4 uses random values without a timestamp.” Choosing v7 again sets the note back to “v7 includes a timestamp for time-based ordering.” and builds a new v7. The identifier that was on screen is not restored. Switching back and forth is not an undo stack. Each change of the radio is a fresh draw, and “Generate again” is a fresh draw that leaves the radio where it is.

With a mouse or trackpad the status reads “Click to copy”. With a coarse pointer, such as a fingertip, it reads “Tap to copy”. A successful copy changes the status to “Copied”, then returns to that hint after 1.4 seconds. The page tries the clipboard interface first. If the browser blocks it, the page selects the identifier and tries the older copy command. If that fails too, the status stays on “Copy unavailable. Select the text and copy manually.” until the next generate. That error does not clear itself after 1.4 seconds. “Generate again”, or a version change, sets the status back to the hint and replaces the value, so copy again from the value you actually want to keep.

The copy uses the text that was on screen when you clicked. If a new identifier lands before that write finishes, the page does not report “Copied” for the old text, and it does not write the new text either. The clipboard can still be holding the previous identifier. When the version and the value are the ones you mean, click the specimen again.

There is no count, no list, and no file. One specimen is the whole result. The button does not generate a batch, and the page has no field for how many identifiers you want. Reload the tab and the specimen is filled again from scratch. Nothing on the page can show you the one you copied five minutes ago.

The specimen is a button, and so is “Generate again”, so a keyboard can focus either one and activate it. The version radios are an ordinary group: arrow keys move the selection, and moving it generates immediately, the same as a click. Without JavaScript the specimen stays empty, the status stays on the initial “Click to copy”, and neither button can build an identifier. The v7 radio is still checked, and the note still reads “v7 includes a timestamp for time-based ordering.”, because that is what the page itself contains before the script runs.

One lowercase string

Every result is 36 characters: 32 hexadecimal digits and four hyphens, in groups of 8-4-4-4-12. Hex digits are 0-9 and a-f only. The page writes them in lowercase. A v4 result has 4 as the first character of the third group. A v7 result has 7 there. The first character of the fourth group is 8, 9, a, or b. That character is the variant. The shape is xxxxxxxx-xxxx-7xxx-yxxx-xxxxxxxxxxxx for v7, and the same shape with 4 in place of 7 for v4. y is one of those four variant digits.

This page does not offer another format. There is no uppercase switch, no control that removes the hyphens, no braces around the string, and no urn:uuid: prefix. RFC 9562 treats the letters as case-insensitive, so an uppercase copy is the same 16 bytes, and many systems also accept the 32 digits with the hyphens deleted. This tool will not produce those forms. If a parser insists on uppercase, or on 32 digits with no hyphens, change the copy you already made. Do not expect a second button here. Generating again only changes the identifier, not the spelling.

The hyphens sit in the same places in every value, so they do not change which of two results sorts first. Comparing these lowercase strings as text follows the hexadecimal order of the 16 bytes. A mixed-case string can sort differently from the bytes, because uppercase and lowercase letters are different characters. This page never mixes case. It also never emits the nil UUID of all zeros, or the max UUID of all f digits, as a choice. Those are values the specification defines. They are not results of the v4 or v7 draw.

UUID v4 vs v7

v4 · Random
Uses random values without a timestamp. Choose it when the identifier must not reveal when it was created. Sorting a column of v4 values does not mean “oldest first”.
v7 · Time-based
Puts the device clock, in Unix milliseconds, in front of random bits. Choose it when that time is useful for ordering. This generator does not guarantee generation order within the same millisecond or when the device clock moves backwards.

v7 is the default because a creation time is what many new identifiers are for: rows that should cluster by when they were minted, file names that should read in time order, and ids you want to eyeball. The cost is that the time is not hidden. Anyone who can see the string can read the clock that produced it. v4 is the other option on this page, and it is the one to use when that leak matters. Account age, an unpublished draft, a support ticket, or an id that will sit in a public URL are all cases where a timestamp in the id tells a stranger something the rest of the record might not.

RFC 9562 also defines other versions. This page implements the version 4 layout and the version 7 layout from that document, and nothing else. There is no v1, which would carry a timestamp and a node identifier. There is no v3 or v5, which are built from a name and a namespace with MD5 or SHA-1. There is no name field here to feed them. There is no v6, the reordered time layout, and no v8. If you need a name-based id, this is the wrong page. The hash tool digests text or a file. It does not format the digest as a UUID.

How each UUID is built

A version 4 UUID is 122 random bits, plus 4 version bits and 2 variant bits, in the 128-bit layout from RFC 9562. When crypto.randomUUID exists, the page shows the string that function returns. The Web Crypto specification defines that string as a version 4 UUID in lowercase hexadecimal with hyphens. When the function is missing, the page fills 16 bytes with crypto.getRandomValues, sets the high four bits of byte 6 to the version nibble 4, sets the high two bits of byte 8 to the variant, and formats those bytes itself. The formatter writes each byte as two lowercase hex digits and inserts hyphens after 8, 12, 16, and 20 hex digits. That is the 8-4-4-4-12 grouping. Neither path uses Math.random().

A version 7 UUID is built only with crypto.getRandomValues and Date.now(). The page still draws 16 random bytes, then overwrites the first 6 of them. Those 6 bytes are the low 48 bits of Date.now(), which is the device clock in Unix milliseconds. Byte 6 then keeps the random low nibble and sets the high nibble to 7. Byte 8 keeps its low 6 bits and sets the variant. What remains random is 12 bits beside the version and 62 bits after the variant: 74 random bits. The 48 bits that used to be random in those first 6 bytes are discarded. The page does not use crypto.randomUUID for v7. That function is a version 4 generator.

The first 12 hex digits are the whole timestamp. Ignore the hyphens, and do not include the 7. That 7 is the version nibble, which replaced 4 bits that are not part of the clock. Twelve hex digits is 48 bits. A thirteenth digit is the version. Reading those 13 digits as the timestamp multiplies the count by 16 and then adds 7.

Take the millisecond instant 1700000000000, which is 2023-11-14T22:13:20.000Z. In hex that count is 018bcfe56800. A v7 UUID minted at that reading of the clock starts with 018bcfe5-6800-7. The leading zero is required. The field is always 12 digits, so an earlier clock still fills the same width. A clock at the Unix epoch would start 00000000-0000-7. One millisecond later, 1700000000001, the prefix becomes 018bcfe5-6801-7. The timestamp converter can turn that millisecond count into a date. This page does not. It never prints the decoded time next to the specimen, so a wrong device clock is not labeled here.

Date.now() is a whole number of milliseconds. The 12 random bits next to the version are random, not a finer clock. You cannot recover microseconds from a UUID this page made, and two events inside the same millisecond do not get different times. The 48-bit field runs out around the year 10889. Past that point the page still generates: it keeps the low 48 bits of the count and drops the rest, so the prefix wraps. That is far outside any clock you are using today. A clock set before 1970 is closer to a real mistake. Date.now() is then negative, and the page still writes its low 48 bits. One millisecond before the epoch is the prefix ffffffff-ffff-7. Read as an unsigned millisecond count, those 12 digits are the last instant the field can hold, not a time in 1969.

What “time order” actually guarantees

The note under v7 says the timestamp is there “for time-based ordering.” The order is the order of the device clock, written once per click, with random bits after it. It is not an order the page checks against the previous specimen, and it is not an order shared with any other machine.

Inside one millisecond the prefix matches and the rest is random. Click order is not kept. RFC 9562 allows the 12 bits beside the version to act as a counter so that several version 7 UUIDs in the same millisecond sort in creation order. This page does not do that. Those 12 bits come from crypto.getRandomValues, and so do the 62 bits after the variant. Two v7 values from the same millisecond sort by those random bits. A later click can sort first. “Generate again” does not wait for the next millisecond, and it does not remember how many values it has already made.

If the device clock moves backwards, a later click can sort first as well. The page does not compare the new timestamp with the old one, because it does not keep the old one. Set the clock back by one second from the example above and the prefix moves from 018bcfe5-6800 to 018bcfe5-6418. Anything that sorts the strings will place the new identifier before the one you generated a moment ago. A step the other way does the reverse. An hour-fast clock at that same instant writes 018bd01c-5680 instead of 018bcfe5-6800. The identifier now claims 2023-11-14T23:13:20.000Z. An hour-slow clock writes 018bcfae-7980 and claims 21:13:20 UTC. The page has no NTP correction and no server clock. Date.now() is whatever the device currently says.

Two devices disagree whenever their clocks disagree. Each one stamps its own Date.now(). A laptop set a few minutes ahead inserts identifiers that sort as if they were created later than a laptop set slow, even when the slow laptop clicked first. Nothing on this page reconciles them. If you need one order across machines, the clocks have to agree to the millisecond, or the order has to come from somewhere else. A v4 column does not pretend otherwise. Its sort is the sort of the random bits, on every machine, with no timestamp to be wrong.

Reading the time back has the same limit. The 12 hex digits are the clock the browser saw, in UTC milliseconds, not a time zone and not a promise that the clock was right. Display that instant in a local zone later if you want. The UUID itself does not store an offset. Changing the zone changes how you print the instant. It does not change the identifier.

Duplicates and primary keys

A duplicate is unlikely, and this page will not be the thing that notices one. It does not check a registry, a database, or the previous value on screen. Uniqueness is enforced where you store the identifier.

Version 4 has 122 random bits. For a 50% chance of some duplicate you would have to generate on the order of 2.7 × 1018 of them. A billion version 4 values, far more than this click-by-click page will ever show one person, still leaves the chance of any collision among them near 9 × 10−20. That is the birthday arithmetic on 122 bits. It is not a quota the page tracks.

Version 7 collides only when the 48-bit timestamps match and the 74 random bits match. Different milliseconds do not collide with each other, no matter what the random bits do. Inside one millisecond the 50% line is about 1.6 × 1011 values, about 160 billion draws that all read the same Date.now(). Two devices collide on those terms only if their clocks report that same millisecond and the 74 bits then match. This page shows one identifier at a time. A person pressing “Generate again” cannot approach either figure. The practical reason to enforce uniqueness in the database is that no generator here consults the database. A bug, a hand-edited copy, or an import of ids from somewhere else can still repeat a value this arithmetic never saw.

As a primary key, the two versions behave differently in an index that sorts the bytes in this order. A v4 key is scattered across the whole id space, so inserts land on random leaves. On a large index that means more page splits and less locality as the table grows. A v7 key shares a prefix that moves forward with the clock, so new keys tend to arrive near the recent end of the index. That is the usual reason to prefer v7 when the table is large and the inserts are the cost you care about.

The “near the end” picture has the same holes as the sort. A burst inside one millisecond is random within that timestamp’s slice, not a counter stepping to the next leaf in click order. A clock that jumps backwards writes into an older part of the index. Two application servers with skewed clocks append to two different ideas of “now”. And the locality exists only if the column orders the UUID the way these bytes do. The lowercase hyphenated string this page copies does, because the time is the first 12 hex digits and the hyphens never move. A column type that rearranges the 16 bytes can scatter v7 keys even though the text form would have clustered. Check the type before you pick v7 for the index. Where the database supports it, store the 16 bytes in a native UUID type or a 16-byte binary column instead of a 36-character string. The string is what you paste. It is a larger key than the bytes it names.

An integer key the database assigns is still smaller, and it is ordered by insertion rather than by a clock. A UUID is what you want when the id has to exist before the insert, or when many systems must mint ids without sharing a counter. This page can mint the id. It does not connect to a database, and it does not insert the row.

An identifier, not a secret

A UUID names a record. It is not a password, and this page is not a password generator. Version 4 is hard to guess. That is a property of 122 bits from a cryptographic generator, and it is still not a secret you type into a login form. There is no length control, no symbol set, and no strength line. The value is meant to be stored and shown. Once it is in a row, a URL, a log, a screenshot, or a chat, anyone who can see that copy has the identifier. Use the password generator when you need a password. Do not paste a UUID from this page into a password field and call it done.

Guessing is the wrong threat for most ids this page will make. v4 ids are not sequential, so a stranger cannot add one to the last id and land on the next record. v7 ids are easier to place in time, and the random tail is 74 bits rather than 122, but walking them one step at a time is still not how you find someone else’s record. Neither fact makes the UUID an access token. If knowing the id is enough to read the record, that is a property of the system that accepts the id, not a promise from this generator. Do not put a UUID in a URL and treat the URL as private just because the page used crypto.getRandomValues.

v7 adds a quieter leak that does not require guessing. The creation time is in the string. Publish the id, and you publish the device clock at the moment of the click, to millisecond resolution, for as long as copies of that id exist. You cannot edit the time out of it on this page. Choose v4 before you generate if the time should stay off the identifier. Choosing v4 after you have already copied a v7 does not change the copy.

The line under the tool says “Generated on your device. Never stored.” Generation uses the browser’s cryptographic random source, and Date.now() for v7. After the page has loaded, another identifier does not take a round trip to DSOOU, and there is no account that could keep one. The server does not render a UUID into the HTML. Access logs for the page view, and any optional page analytics, are described in the privacy policy. Those logs are not a copy of the specimen.

Local is not the same as invisible. The identifier is on the screen until you replace it or leave. The clipboard belongs to the device. After “Copied”, the string sits there until some other copy replaces it. The page does not clear the clipboard when “Copied” fades, when you press “Generate again”, or when you close the tab. A clipboard history, a password manager watching the clipboard, or a clipboard that syncs to another device can all read an identifier you only meant to paste once. Paste it where it belongs, then copy something else if the device will not forget the clipboard on its own. If you do not need the value, generate again before you walk away, so an unused identifier is not the last thing left on screen. There is still no history behind that new one.

Common questions

What is the difference between UUID v4 and v7?

v4 is 122 random bits plus the version and variant. It has no timestamp, so it does not reveal when it was created, and sorting v4 values is not time order. v7 writes your device clock, Date.now() in Unix milliseconds, into the first 48 bits, then 74 random bits. Later clocks usually sort after earlier ones. The same millisecond is not ordered: those 74 bits are random, not a counter, so click order inside that millisecond is not kept. A clock that moves backwards can sort a newer click first. Anyone who can see a v7 UUID can read the clock from the first 12 hex digits. v7 is selected when this page loads.

How likely is a duplicate UUID?

Extremely unlikely, and this page will not be what notices one. A v4 UUID has 122 random bits: on the order of 2.7 × 1018 of them for a 50% chance of some duplicate. A v7 UUID collides only when the millisecond timestamps match and the 74 random bits match. Inside one millisecond that 50% line is about 1.6 × 1011 draws. Different milliseconds do not collide with each other. This tool shows one identifier at a time and does not check a registry or the previous value, so enforce uniqueness where you store them.

Can I use a UUID as a database primary key?

Yes. Many databases do. Random v4 keys land at scattered positions in an index, which can slow inserts on large tables. Time-ordered v7 keys are added near the recent end when the column sorts these bytes and the clock moves forward. A burst in the same millisecond is still random inside that slice, and a clock step backwards writes into an older part of the index. The lowercase hyphenated string this page copies sorts by time. A column type that rearranges the 16 bytes may not. Where your database supports it, store them in a native UUID type or a 16-byte binary column instead of a 36-character string. This page does not insert the row.

Should UUIDs be uppercase or lowercase, with or without hyphens?

This tool outputs lowercase hexadecimal with hyphens, 36 characters in groups of 8-4-4-4-12, the form described in RFC 9562. UUIDs are not case-sensitive, so an uppercase version is the same 16 bytes, and many systems also accept the 32 digits without hyphens. This tool does not offer those forms, and it does not add braces or a urn:uuid: prefix. Generate again changes the identifier, not the spelling. Change a copy you already made if a parser insists on another spelling.

Why did the UUID change when I only switched version?

Switching the Version radios builds a new identifier immediately. v7 is selected when the page loads. Choosing v4 replaces the value, and the note changes to “v4 uses random values without a timestamp.” Choosing v7 again builds another v7. The previous identifier is not restored. “Generate again” also replaces the value, and it keeps the version you already selected. The page keeps only the identifier on screen.

Are generated UUIDs sent to DSOOU?

No. Generation happens in your browser. v4 uses crypto.randomUUID when the browser has it, and crypto.getRandomValues otherwise. v7 uses crypto.getRandomValues and Date.now(). DSOOU does not upload or save the results. The line under the tool says “Generated on your device. Never stored.” A UUID identifies a record. It is not a password, and it is not a secret token. Use the password generator when you need a password.