oktools

UUID Generator

Generate random UUID v4 or time-ordered UUID v7 identifiers — also known as GUIDs — one at a time or up to 500 in bulk, from your browser's cryptographically secure random source. Switch hyphens, case and braces without regenerating the values.

Version
Format

Generated UUIDs (0)

UUID v4 is 122 random bits from the browser's cryptographic generator (crypto.getRandomValues), with the version and variant bits set as RFC 9562 requires.

UUID v7 opens with a 48-bit Unix millisecond timestamp and a counter, then 62 random bits, so a batch sorts in the order it was generated — the better fit for database keys.

How it works

A UUID is 128 bits written as 32 hexadecimal digits. For version 4 the page asks the browser for sixteen random bytes through crypto.getRandomValues, the generator behind the Web Crypto API, and then overwrites six bits: the high four bits of the seventh byte become 0100 to mark version 4, and the top two bits of the ninth byte become 10, the RFC 9562 variant. The other 122 bits stay random, which is why the thirteenth digit of every v4 is a 4 and the seventeenth is always 8, 9, a or b, and why the chance of two colliding is negligible.

Version 7 opens with the current Unix time in milliseconds, written big-endian into the first 48 bits so string order is creation order. The twelve bits after the version digit, random in a v4, hold a counter: seeded randomly in the lower half of its range each new millisecond and stepped up for every further UUID minted in that same millisecond, so a batch of five hundred in one tick still comes out in strictly increasing order. If the counter would overflow, or the clock steps backwards, the timestamp is nudged a millisecond ahead so two values never tie. The remaining 62 bits are random.

Formatting is separate from generation. The raw digits are kept and only re-laid-out when hyphens, upper case or braces are toggled, so a list copied with hyphens and the same list copied without are the same identifiers, and nothing is regenerated by accident. A batch is one to five hundred values; each has its own copy button, and a plain-text box lists them one per line for pasting into a fixture or a spreadsheet column.

Examples

Generate a random UUID v4

The 4 that opens the third group is the version and the b that opens the fourth is the variant; the other thirty digits are random. This is one real value from the generator, and every run produces a different one.

Settings
Version: v4 — random
Quantity: 1
UUID
7bcdedb8-0b58-4102-b3e3-9895f67e387a

Get a time-ordered UUID v7

The first twelve digits, 01a18446396a, are the millisecond timestamp 1793220557162 — 28 October 2026, 20:49:17.162 UTC — so the value records when it was made. The 7 that follows is the version and the 007 after it is the counter.

Settings
Version: v7 — time-ordered
Quantity: 1
UUID
01a18446-396a-7007-806b-7fc164374bd4

Mint a batch that sorts in creation order

All five were produced in the same millisecond, so they share their first twelve digits, and the counter after the version digit — 007, 008, 009, 00a, 00b — keeps them in the order they were made where the clock alone could not. Sorting them as strings gives the same order.

Settings
Version: v7 — time-ordered
Quantity: 5
Plain text
01a18446-396a-7007-806b-7fc164374bd4
01a18446-396a-7008-b0b1-0156599766a2
01a18446-396a-7009-b647-0b5861b46662
01a18446-396a-700a-9a95-e8e33f50c4ea
01a18446-396a-700b-974e-c65ae2075d22

Show a GUID the way Windows tooling writes it

Ticking UPPERCASE and Braces re-lays-out the digits already on screen rather than generating new ones; untick With hyphens and the same value becomes 7bcdedb80b584102b3e39895f67e387a. The braced form is what a .NET Guid literal, a COM class ID or a registry key expects.

UUID in the default format
7bcdedb8-0b58-4102-b3e3-9895f67e387a
UPPERCASE with braces
{7BCDEDB8-0B58-4102-B3E3-9895F67E387A}

Supported formats

  • UUID v4, randomRFC 9562 version 4: 122 random bits from crypto.getRandomValues with the version and variant bits set, 32 lower-case hex digits before formatting.
  • UUID v7, time-orderedA 48-bit Unix millisecond timestamp, a 12-bit counter and 62 random bits, with the version and variant bits set. A batch is strictly increasing even when several values share a millisecond.
  • Four layout switchesHyphenated 8-4-4-4-12 (the default) or 32 digits run together, lower or upper case, with or without braces — any combination, applied to the values on screen without regenerating them.
  • Batches of up to 500A quantity slider from 1 to 500, a copy button per value, Copy All for the whole list, and a plain-text box with one UUID per line.

Use cases

  • Primary keys for a new tablePick v7 so inserts land at the end of a B-tree index instead of scattering across it, while the key stays unguessable and can be minted by any client without a round trip.
  • Fixtures, seed files and test dataFive hundred values in one paste, hyphenated or not, give a fixtures file or a CSV column stable identifiers that do not collide with anything in production.
  • Correlation and request IDsA v4 for a trace, a support ticket or an idempotency key when the identifier must not reveal when it was created.
  • GUIDs for .NET, SQL Server and WindowsUpper case with braces for a Guid literal, a COM class ID, an installer product code or a registry key, where tooling prints them that way.

Limitations

  • Only versions 4 and 7No v1 or v6, which embed a MAC address or a 100-nanosecond clock, and no v3 or v5, which hash a name into a namespace; the nil and max UUIDs are not offered either. A name-based identifier needs a library such as the uuid package.
  • It does not inspect a UUID you pasteThere is no input field: the page cannot tell you the version of an existing value or read the timestamp out of someone else’s v7. The layout switches only act on values it generated.
  • A v7 tells when it was madeThe leading 48 bits are a plain millisecond timestamp that anyone holding the value can read. Choose v4 where creation time is sensitive, such as an invitation token or a password-reset link.
  • Ordering is guaranteed within one batchEach press of Generate starts a fresh counter, so two batches minted in the same millisecond are not guaranteed to sort in the order the button was pressed — only within a batch is the sequence strict.

Frequently asked questions

What is a UUID v4?

A 128-bit identifier whose bits are random apart from six that mark the version and variant, written as 32 hexadecimal digits in five hyphen-separated groups. Because it needs no central authority to hand it out, any machine can mint one that will not collide with anyone else’s.

What is a UUID v7, and when should I pick it over v4?

A v7 UUID starts with a 48-bit Unix millisecond timestamp, followed by a counter and 62 random bits, so a batch sorts in the order it was created and a v7 value is still unguessable. Pick v7 for database keys and anything stored in time order — inserts land at the end of an index instead of all over it — and v4 when the time of creation should not be readable from the identifier.

Is a GUID the same thing as a UUID?

Yes, in practice. GUID is Microsoft’s name for the same 128-bit identifier, and the two terms are interchangeable across .NET, SQL Server and the wider ecosystem. The only differences you will meet are cosmetic: some Microsoft tooling shows them in upper case or wrapped in braces, both of which are format options here.

Are random UUIDs really unique?

For every practical purpose, yes. A v4 UUID has 122 random bits, and you would need to generate on the order of a billion a second for about 85 years before a single collision became likely. The real risk is not the mathematics but a weak random source, which is why these come from your browser’s cryptographic generator.

Can I generate several UUIDs at once?

Yes — set the count and up to five hundred are produced together, with a button to copy the whole list one per line. That is the usual shape for seeding a fixtures file or filling a column of test rows. Changing the format afterwards only re-lays-out the same values, so you can copy them with and without hyphens.

Should I use a UUID as a database primary key?

It is a reasonable choice when IDs must be generated by clients, across shards or offline, and it avoids leaking a row count the way a sequential integer does. The costs are a wider key and, for v4, random insert order that fragments a clustered index — which is what the time-ordered UUID v7 offered here was designed to fix.

Are the UUIDs generated on a server?

No. They are produced in your browser from crypto.getRandomValues, so the values never exist anywhere else and nothing is transmitted. That also means the same UUID can never be handed to two visitors.