UUID v4 Generator
v4 by default, plus time-ordered v7 and v1 — in bulk, in your browser
What this UUID v4 generator does
Generates UUIDs in bulk — v4 (random) by default, with v7 (time-sorted) and v1 (timestamp) one click away — up to 10,000 at a time. It all happens in the browser, so your identifiers are generated locally and never sent anywhere.
You probably know when you need one: a primary key, an API resource ID, a session token, test fixtures. The details this tool handles are the boring but useful ones — uppercase output if your database or system prefers it, and stripping the hyphens for a compact 32-character format.
What a UUID v4 actually is
Thirty-six characters, five groups, four hyphens:
550e8400-e29b-41d4-a716-446655440000. The 4 at the start of the third
group is the version. The first character of the fourth group is the
variant, and it is always one of
8,
9,
a or
b — that is the pattern to check
when you are validating a string you did not generate yourself.
Of the 128 bits, 122 are random and 6 are those fixed version and
variant bits. The randomness comes from
crypto.getRandomValues, not from
Math.random — a distinction that
matters, because a seeded or predictable generator makes collisions
findable instead of merely unlikely.
How unlikely? You would have to generate roughly 2.7 × 10¹⁸ v4 UUIDs before the chance of any two matching reached 50%. At a billion IDs a second that is about 86 years of generating, so for practical purposes a v4 collision is not a thing you defend against — you defend against a broken random source.
UUID v4 vs v7 — which one should be the primary key?
Both are 128-bit, both are UUIDs, and the difference is entirely in the first bits. v4 starts with randomness. v7, standardized in RFC 9562, starts with a 48-bit Unix millisecond timestamp, then a 12-bit counter, then 62 random bits.
-
v4 — random
For public IDs, tokens, anything exposed in a URL or API. The catch: random inserts scatter across a B-tree index.
-
v7 — by creation time
For primary keys, event rows, anything inserted in bulk. The catch: the creation time is readable from the ID.
-
v1 — by creation time
For legacy systems that already expect v1. The catch: it also embeds a node ID — a MAC address, in most implementations.
The sorting matters more than it sounds. A B-tree index stores keys in order, so a random v4 key lands in an arbitrary leaf page: the index grows in every direction at once, pages split, and the working set stops fitting in memory. A v7 key always appends near the right edge, which keeps the index compact and the writes sequential. If your table is small this is noise; once it is tens of millions of rows it is the difference between a healthy cache hit ratio and a hot spot.
The counter in the middle exists for the case that would otherwise break ordering: several IDs generated inside the same millisecond. This generator seeds it randomly per millisecond and increments it, so IDs stay strictly increasing even when 10,000 of them are created in one batch. The 48-bit timestamp does not run out until the year 10889.
About that catch: a v7 ID tells anyone holding it roughly when the row was created. Usually that is harmless. If it is not — a public URL where the creation time is commercially interesting — keep v4, or keep v7 internal and expose a separate opaque ID.
“UUID v4”, “uuidv4”, “uuid4” — the same thing?
Yes. The value is identical no matter how the name is written; the
spelling only tells you which ecosystem the writer came from.
UUID v4 is the RFC name.
uuidv4 is how it appears in
JavaScript — the uuid package
exposes exactly that function name.
uuid4 is the Python one, as in
uuid.uuid4(), and Java spells it
UUID.randomUUID() without a
version number at all.
So “v4 UUID generator” and “UUID generator v4” are the same request, and this page is the same answer: one algorithm, four spellings, same 36 characters out.
Hyphens, uppercase, and the 32-character form
The canonical form has hyphens and lowercase hex. Two variations cover most of the reasons you would want something else: remove hyphens gives the 32-character form that some databases, APIs and file names expect, and uppercase gives A–F in capitals for systems that store or print identifiers that way.
Both are still the same 128 bits — the hyphens and the letter case carry no data, so a stripped UUID converts back by reinserting the dashes at 8, 12, 16 and 20. If two systems disagree about which form they accept, this is why.
Frequently Asked Questions
What is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit label formatted as 36 characters (32 hexadecimal digits with four hyphens), for example 550e8400-e29b-41d4-a716-446655440000. UUIDs are used to identify records, entities and resources without a central registry.
What is a UUID v4 and how is it generated?
A v4 UUID is 122 random bits plus 6 fixed bits that mark the version and variant. The random part comes from a cryptographic generator, so two v4 values are independent of each other and of the machine that made them. You can recognize one by the 4 at the start of the third group and the 8, 9, a or b at the start of the fourth.
What is UUID v7 and when should I use it?
UUID v7, standardized in RFC 9562, puts a 48-bit Unix millisecond timestamp at the front, then a 12-bit counter, then 62 random bits. Because the timestamp leads, the strings sort by creation time — which keeps inserts sequential in a B-tree primary key instead of scattering them. Use v7 for database keys and event rows; the trade-off is that the creation time is readable from the ID.
Is uuidv4 the same as UUID v4?
Yes. The value is identical; only the spelling differs by ecosystem. "UUID v4" is the RFC name, "uuidv4" is the JavaScript function name from the uuid package, "uuid4" is Python (uuid.uuid4()) and Java calls it UUID.randomUUID(). Searching for v4 UUID generator or UUID generator v4 asks the same question.
Can I use a UUID as a database primary key?
Yes, and it is common. Two things are worth knowing: a UUID is 16 bytes against 8 for a bigint, so the index is physically larger, and a random v4 key inserts at random positions, which costs you page splits on large tables. A v7 key sorts by time and appends at the end of the index, so it keeps the storage benefit of a UUID without that particular cost.
What is the difference between UUID v1 and v4?
UUID v4 is generated from random numbers and is the usual choice for database keys and API IDs. UUID v1 embeds a timestamp plus a node identifier, so values sort roughly by creation time. This tool uses a random node ID instead of your network card MAC address, so generated IDs cannot be traced back to a device.
Can I generate many UUIDs at once?
Yes. Set the count up to 10,000 and click "Generate UUIDs" to create them in bulk — handy when you are seeding test data, fixtures or migration scripts. Copy all or download them as a .txt file.
Can I remove hyphens or use uppercase letters?
Yes. Enable "Uppercase letters" to get A-F uppercase hex digits, or "Remove hyphens" for a compact 32-character format often required by databases, file names and legacy systems.
Are generated UUIDs private?
Yes. Generation happens entirely in your browser using the Web Crypto API. Your UUIDs are never sent to any server, so they are safe to use as keys and identifiers.