UUID Generator (v4 and v7)
Generate one unique ID or a thousand, ready to paste straight into your project.
- Version
- –
- Variant
- –
- Embedded timestamp
- –
Free forever, no sign-up and no limits, and this tool installs on its own so you can keep it on your home screen.
Generate UUIDs in bulk, random v4, or time-sortable v7 for database keys. Generate one or a thousand, shaped for wherever they are going: one per line, a JSON array or a quoted comma list, in uppercase, brace-wrapped or hyphen-free form if that is what your system expects. An inspector reads any pasted UUID back: its version, its variant, and for v1 and v7 the creation time hiding inside it.
How to use it
- Choose a versionv4 for general-purpose random identifiers, v7 when the values will become database keys and you want them to sort by creation time.
- Pick a shapeOne per line for a file, a JSON array for a fixture, a quoted comma list for an SQL IN clause. Uppercase, braces and hyphen stripping stack on top.
- Copy, or inspectCopy all puts the whole output on your clipboard. Paste any UUID into the inspector below to read what it says about itself.
What the parts mean
A UUID looks like 0192f8c1-4d3e-7a2b-9c1d-5e6f7a8b9c0d. The digit beginning the third group is the version (4 or 7 here) and the first digit of the fourth group encodes the variant, which is why it is almost always 8, 9, a or b. Those bits are fixed by the specification, which is why a UUID has 122 random bits rather than 128.
Why v7 exists
Random UUIDs have a well-documented cost as database primary keys. Databases store indexes as balanced trees ordered by key. Insert sequential keys and each new row goes at the end, touching one page. Insert random keys and every row lands somewhere different, so the database keeps loading and splitting pages all over the index. On a large table the write slowdown and the disk churn are substantial.
v7 fixes this without giving up independent generation. Because the leading 48 bits are the current time in milliseconds, identifiers made close together sort close together, so inserts cluster the way sequential integers do. You keep the ability to generate keys anywhere, and lose the index fragmentation.
One detail matters if you generate them in bulk. A loop produces thousands of identifiers inside a single millisecond, and if the bits after the timestamp were purely random they would sort arbitrarily, losing exactly the property you chose v7 for. This generator uses the monotonic counter the specification allows, so a batch of a thousand comes out in order rather than merely grouped by millisecond.
It was standardised in RFC 9562 in 2024, replacing a decade of homegrown variants that solved the same problem incompatibly.
Reading a UUID back
A UUID also answers questions, if you know where to look, and the inspector under the generator looks for you. Paste any UUID and it reports the version (which recipe made it), the variant (which standard's bit layout it follows), and for v1 and v7, the timestamp embedded in it decoded to a readable date. That last one is regularly useful in debugging: a v7 primary key quietly records when its row was created, so a mysterious record's identifier can tell you it appeared at 3am during the failed deploy. It works the other way too: before choosing v7 for anything public, paste one and see exactly how much it tells a stranger.
Where UUIDs are worth it
They are the natural choice when identifiers must be created without coordination, offline mobile clients, several services writing to the same table, or data merged from systems that each had their own counter. They also avoid leaking business information: a sequential integer in a URL tells anyone who looks roughly how many records you have and lets them guess neighbouring ones.
The trade-off is size and readability. A UUID takes 16 bytes stored properly, or 36 characters as text, against 4 or 8 for an integer, and nobody reads one aloud. For a small single-database application, an auto-incrementing integer is usually the better engineering choice.
Questions people ask
What is a UUID?
A 128-bit identifier, written as 32 hexadecimal digits in five hyphen-separated groups. The point is that anyone can generate one independently, without a central registry, and it will still be unique in practice. That makes them ideal for distributed systems, offline clients and merging data from several sources.
What is the difference between v4 and v7?
v4 is 122 random bits and nothing else. v7 puts a 48-bit millisecond timestamp at the front, followed by a counter and random bits. Both are unique; the difference is ordering. Sorting v7 identifiers as text also sorts them by creation time, which v4 cannot do.
Do bulk-generated v7 identifiers still sort correctly?
Yes. Generating a thousand identifiers takes well under a millisecond, so they would all share a timestamp, and with purely random tails they would sort arbitrarily, defeating the point. This generator uses the monotonic counter that RFC 9562 permits, giving 4096 ordered values per millisecond before rolling into the next one. Generate a thousand and they come out in order.
Which should I use?
Use v7 for anything that becomes a primary key in a database. Random v4 keys scatter inserts across a B-tree index, which fragments it and slows writes as the table grows, a well-known problem with UUID primary keys. v7 keys are near-sequential, so inserts land together and the index stays healthy. Use v4 when you specifically do not want creation time to be inferable.
Can two UUIDs ever collide?
In theory yes, in practice no. A v4 UUID has 122 random bits, about 5.3 undecillion possibilities. You would need to generate roughly 2.7 quintillion of them before reaching a one-in-a-billion chance of a single collision. It is not a guarantee in the mathematical sense, but it is a safer bet than most things a system depends on.
Are these random enough to be secret?
They come from crypto.getRandomValues, the browser's cryptographically secure generator, so a v4 UUID is unpredictable. That said, UUIDs are identifiers rather than secrets, they routinely appear in URLs and logs. If you need a token nobody can guess or replay, use a purpose-built secret with an expiry, not a UUID.
Does v7 leak when something was created?
Yes, deliberately. The timestamp is readable by anyone holding the identifier. That is the feature, but it means v7 is the wrong choice if the creation time is itself sensitive.
How many can I generate at once?
Up to a thousand in a single run, which covers a test fixture, a seed file or a batch of database keys. Copy all puts the whole set on the clipboard in the shape you picked, so it goes straight into a JSON array or an SQL IN clause without reformatting.