Skip to tool
ecech.
💻 Developer & Code

Free Bulk UUID v4 Generator with Real Cryptographic Randomness

Generate one or ten thousand at once, formatted for SQL, JSON, CSV or a plain list — from the browser's crypto RNG, not Math.random, which is the difference that matters.

Length

Random bits

Sortable

50% collision after

Advertisement

How the calculation works

A UUID v4 is 122 random bits with 6 bits spoken for f47ac10b - 58cc - 4372 - a567 - 0e02b2c3d479 version always 4 variant 8, 9, a or b 2¹²² possibilities You would need 2.7 quintillion before a 50% chance of a collision. That is why nobody checks for duplicates. It is also why the randomness source has to be real.

How to Use This Tool

A UUID is a 128-bit identifier you can generate anywhere, on any machine, without coordinating with anything else, and still be confident it is unique. That property is the entire point, and it depends completely on the randomness being real. A generator using Math.random() produces identifiers that look identical and are not safe, which is why this one uses the browser's cryptographic random source.

Generating

Set a count from 1 to 10,000, pick a type, choose an output format and press Generate. Options for uppercase, braces and hyphen removal appear where they apply. The output is ready to paste into a migration, a fixture file or a spreadsheet without further editing.

Which type to use

  • UUID v4 is the default and the right answer most of the time. Fully random, universally supported, recognised by every database and language.
  • UUID v7 puts a millisecond timestamp in the first 48 bits, so identifiers sort roughly in creation order. This matters enormously for database performance: random primary keys scatter writes across a B-tree index, while time-ordered ones append, which can be several times faster on large tables.
  • ULID is also time-ordered but encodes to 26 characters instead of 36, using an alphabet that avoids I, L, O and U so it cannot be misread aloud or produce accidental words.
  • Nano ID is 21 URL-safe characters with 126 bits of entropy — shorter than a UUID, more random, and designed for public identifiers in URLs.
Length, and whether they sort in creation order UUID v4 36 chars random order UUID v7 36 chars time-ordered ULID 26 chars time-ordered Nano ID 21 chars random order For a database primary key, time-ordered is worth switching to. For a public URL, shorter is.
All four have more than enough entropy to never collide in practice. The real decision is index performance versus URL length.

Why Math.random is not acceptable

JavaScript's Math.random() is a fast pseudo-random generator seeded from a small internal state. Its output is statistically fine for shuffling a playlist and completely unsuitable for identifiers, because the sequence is predictable from a handful of observed outputs. If your UUIDs are session tokens, password reset links, invitation codes or anything else an attacker would like to guess, a Math.random generator hands them the next value. Everything here uses crypto.getRandomValues().

The collision maths, honestly

UUID v4 has 122 random bits, giving roughly 5.3 × 10³⁶ possibilities. By the birthday bound you would need about 2.7 quintillion identifiers before reaching a 50% chance of any two matching. Generating a billion a second, that takes longer than the age of the universe. This is why production systems do not check for duplicates — not because collisions are impossible, but because they are less likely than the hardware failing.

Advertisement

Frequently Asked Questions

Are these UUIDs safe to use in production?
Yes. They come from crypto.getRandomValues, the browser's cryptographically secure random source, and follow RFC 4122 including the correct version and variant bits. They are generated locally and never transmitted, so nobody else has seen them.
Why does it matter whether Math.random is used?
Because Math.random is a predictable pseudo-random generator. Given a few observed outputs its internal state can be recovered and future values predicted. For shuffling a list that is fine; for identifiers that might be session tokens, reset links or invitation codes it hands an attacker the next value.
What is UUID v7 and should I use it?
It places a millisecond timestamp in the first 48 bits so identifiers sort in creation order. That matters for database performance: random primary keys scatter writes across the index, while time-ordered ones append. On large tables the difference is substantial. Use v7 for primary keys, v4 where ordering must reveal nothing.
How likely is a UUID collision?
Vanishingly. UUID v4 has 122 random bits, about 5.3 × 10^36 possibilities. You would need roughly 2.7 quintillion of them before a 50% chance of any two matching. Generating a billion per second, that takes longer than the universe has existed.
What is the difference between a UUID and a GUID?
Nothing meaningful. GUID is Microsoft's name for the same 128-bit identifier. The main difference is presentation — Microsoft tooling often wraps them in braces and uses uppercase. Both options are available here, and the underlying value is identical.
Should I use a UUID as a database primary key?
It depends on your database. Random v4 keys hurt insert performance on clustered indexes such as MySQL InnoDB, because each write lands in a different page. UUID v7 or ULID solves that by sorting chronologically. PostgreSQL with a non-clustered index cares far less.
Is anything sent to a server?
No. Everything is generated in your browser and nothing leaves it. That matters if the identifiers will become API keys, invitation codes or anything else whose value depends on nobody else having seen it.

Related tools in Developer & Code

Browse all Developer & Code tools
A handwritten note reading ecech.com resting on the keyboard used to build the site.

Made by one person

ecech. is not a content farm. Every tool here is written and checked by hand, one at a time, by someone who wanted the tool to exist and could not find a version that showed its working.

No accounts and no sign-in, and nothing you type reaches a server — every calculation on this page runs inside your browser. The ads are served by Google and do set their own cookies, which is set out in full on the privacy page. More about the site.