By Tim King · Updated
UUID Generator
Lowercase, Uppercase, Braced or URN Forms in Bulk, Version 4 or 7
OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.
How the UUID Generator works
This uuid generator gives a fresh list with every click. Generate UUIDs without leaving the page. Pick version 4 for pure randomness or version 7 for identifiers that sort in the order they were created, ask for as many as five hundred at once, and take them in whichever shape your database, config file or test fixture expects. Everything is generated on your own machine.
Uuid generator: how the names are built
A UUID is a 128-bit number written as 32 hexadecimal digits in five hyphenated groups. The point of it is that you can mint one anywhere — on a phone that has been offline for a week, in a test that runs a thousand times a second, in two datacentres at once — and be confident nobody else has ever produced the same one. No coordination, no central counter, no round trip to ask the database what the next number is.
Version 4 is random, and that is all it is. 122 of the 128 bits come from a cryptographically secure random number generator; the other six are fixed markers saying "version 4" and "variant 1". The collision risk is the birthday problem on a space of 2¹²². To reach a one in a billion chance of a single duplicate you would need to generate around 10¹⁶ of them. You will not collide. This is the version to use when the identifier should reveal nothing at all — not when it was made, not by which machine, not how many came before it.
Version 7 puts the clock in front. The first 48 bits are a Unix millisecond timestamp, and the remaining 74 are random. Because the timestamp is big-endian and leads the value, sorting v7 UUIDs as text or as bytes sorts them by creation time — with one caveat worth knowing: two made in the same millisecond differ only in their random tail, so their order relative to each other is arbitrary. Everything else about them — uniqueness, the fact that you can generate them offline — is unchanged.
Why that matters, and it is the thing most people learn the hard way. Databases store rows in B-tree indexes, and a B-tree is cheapest to maintain when new keys arrive at the right-hand edge. An auto-incrementing integer does exactly that: every insert lands on the page already in memory. A v4 UUID lands in a uniformly random position instead, so each insert dirties a different page, the cache stops helping, and pages split down the middle rather than filling. On a large table under sustained insert load this is not a rounding error — it is the difference between a write path that keeps up and one that does not. It is the reason "don't use random UUIDs as your clustered primary key" became folklore. Version 7 exists to end that argument: you keep the generate-anywhere property and you get back the sequential insert pattern.
The cost of v7 is that it leaks time. Anyone holding one of your identifiers can read the millisecond it was created, and holding two tells them how far apart the two records were made. For an order ID that is usually harmless and occasionally useful. For a password-reset token, a share link or anything an outsider will see, it is information you did not mean to publish — use v4 there, or a random token that is not a UUID at all.
The other versions. Version 1 is the original, built from a timestamp and the machine's MAC address, which is why it fell out of favour. Versions 3 and 5 hash a name inside a namespace, so the same input always yields the same UUID — handy for deriving a stable ID from something you already have. Version 6 reorders v1's timestamp to make it sortable. For new work the practical choice is between 4 and 7, which is why those are the two offered here.
FAQ
What is the difference between a UUID and a GUID?
Nothing meaningful. GUID is Microsoft's name for the same 128-bit identifier, and the two terms are used interchangeably. You will see GUIDs written in braces in Windows tooling and registry files, which is the brace format offered here; the value inside is an ordinary UUID.
Can two UUIDs ever be the same?
In theory yes, in practice no. A version 4 UUID draws 122 random bits, so the space holds about 5.3 × 10³⁶ values. Generating a billion per second for a century leaves the odds of a single collision far below the odds of the storage silently corrupting the value instead.
Should I use a UUID as my database primary key?
You can, but use version 7 rather than version 4 if the table takes a lot of inserts. Random keys scatter writes across a B-tree index and cause page splits, while v7's leading timestamp keeps new rows arriving at the end of the index the way an auto-incrementing integer does.
Are these UUIDs generated on a server?
No. Version 4 uses your browser's built-in crypto.randomUUID, and version 7 is assembled from
crypto.getRandomValues — both backed by your operating system's cryptographically secure random
number generator. Nothing is requested from a server, nothing is logged, and reloading the page
loses them permanently.
Is a v4 UUID safe to use as a secret token?
It is random enough — 122 bits from a secure generator is far beyond what a session token needs. The risk is habit rather than entropy: UUIDs get logged, put in URLs and pasted into tickets because they look like identifiers rather than secrets, so a purpose-built token is safer.
See also: all Security & Identifiers tools, Dev Utilities, Formatters & Validators, Data & Encoding, SEO, Accessibility, AI.
Related tools
Dice Roller
Roll D6, D20 or any custom die with a fair random generator.
Filename Generator
Safe, consistent file names from plain words, with dates and suffixes.
Passphrase Generator
Diceware passphrases from the EFF wordlist, generated locally.
QR Code Generator
QR codes for links, Wi-Fi, contact cards and more, as a PNG.
Random PIN Generator
Random 4, 6 or 8 digit PINs, avoiding 1234 and 0000.