Need an ID that nobody else will ever produce? This UUID generator makes a v4 (random) or v7 (time-ordered) ID in your browser, one at a time or in bulk. Pick a version, set a count and copy the result. Each value is 128 bits long and comes from a cryptographically secure source, so you can generate UUID values for tests, records and APIs without asking a server.
How to Use the UUID Generator
- Choose a version. The v4 option gives pure randomness; v7 puts a timestamp first.
- Set the count from 1 to 1,000.
- Adjust the format: case, hyphens, quotes or a list layout.
- Click Generate, then copy the output.
Everything runs client-side, in your browser, so nothing you create is uploaded or stored. Used as a UUID v4 generator, it also works offline once the page has loaded, which suits air-gapped test setups and quick scratch work.
Copy All, Download and the UUID Inspector
Use Copy all for the whole list, or download it as a text, JSON or CSV file. Paste any existing ID into the UUID inspector and the validator reports its version, variant and, for time-based types, the embedded date.
What Is a Universally Unique Identifier?
A universally unique identifier is a 128-bit label any machine can create alone, with no central registry. It is written as 32 hexadecimal digits in five groups, following the 8-4-4-4-12 pattern, for 36 characters including hyphens. Microsoft calls the same thing a globally unique identifier. For example: 98cdc79b-8669-4bfb-abe6-79fe5691673e.
RFC 9562 Format and Variant Bits
The current standard is RFC 9562, which replaced RFC 4122 in 2024. Two hex digits carry metadata. The 13th is the version, so the 4 in 4bfb marks version 4. The 17th holds the variant and is always 8, 9, a or b; here it is a.
UUID v4 vs v7: Which Version to Use
Both versions are safe to create anywhere. They differ in what fills the bits.
| Version | How it is built | Best for |
|---|---|---|
| v1 | Timestamp plus MAC address | Legacy systems only |
| v3 / v5 | MD5 or SHA-1 hash of a namespace and a name; deterministic | Stable IDs from names |
| v4 | 122 random bits | Opaque IDs |
| v7 | 48-bit Unix timestamp plus random bits | Sorted database keys |
Version 4: Random Bits
In a v4 ID, 122 random bits fill the value and the other 6 mark the version and variant. Because it is opaque, it reveals nothing about when or where it was made, which suits share links and external references. A v4 value from crypto.randomUUID() draws on the browser's cryptographic random number generator, the same source it uses for encryption. If you prefer a shorter text form, a ULID also sorts by time but uses 26 base32 characters instead of 36.
Version 7: Time-Ordered Timestamp
Version 7 starts with a 48-bit timestamp in milliseconds, so IDs sort by creation time and stay sorted when you order them as text. Within one millisecond a counter keeps the order, so a fast run never comes out shuffled. The price is privacy: anyone can read the creation time.
GUID vs UUID Output Formats
A GUID is a UUID by another name, so only the presentation differs. Choose the format your target system expects; a GUID generator workflow in .NET usually wants uppercase with curly brackets, while databases and JSON APIs expect plain hex. Changing the format never changes the underlying 128-bit value, so converting between styles is always safe.
Uppercase, No Hyphens and Braces
- Uppercase or lowercase: RFC 9562 outputs lowercase but accepts either.
- No hyphens: a compact 32-character string for file names and
BINARY(16)imports. - Braces and quotes:
{...}for Windows, single quotes for SQL, double quotes for JSON. - A custom separator or wrapper adds prefixes or commas.
Seeding 250,000 Rows with a Bulk UUID v7 Generator
Priya Nair is loading a staging database for an orders service and has to decide between two keys before the import script runs. She needs 250,000 IDs, and the orders table will take heavy daily inserts, so insert order matters.
She opens this tool, sets the version to v7, the count to 1,000, lowercase with hyphens, and picks the JSON array layout. She repeats the run 250 times and checks each batch against the duplicate summary. She pastes the first ID into the inspector, and the leading 48 bits decode to the creation millisecond, as expected.
Then she checks the odds. With the birthday formula, 250,000 IDs give p = 250,000² ÷ (2 × 2122) ≈ 5.9 × 10-27, so duplicates are not a concern. Storage is the real cost: as 36-character strings these IDs use 20 more bytes each than BINARY(16), about 4.8 MiB extra for the column alone, before its index.
| Rows | Collision probability | Extra bytes as text |
|---|---|---|
| 250,000 | 5.9 × 10-27 | 5,000,000 |
| 4,000,000 | 1.5 × 10-24 | 80,000,000 |
The sensitivity rerun settles it: even at 4 million rows the risk stays negligible, but the text overhead grows 16-fold, so she stores the key as BINARY(16). What she watches is insert order, not duplicates. One caveat: v7 values from several app servers interleave only to the millisecond, so cross-server order is approximate, and she never treats the ID as an exact audit timestamp. Her next action is to run the import in a single transaction and compare insert times against a v4 trial.
How Unique Is a Random UUID? Collision Probability
Enough that separate servers, phones and browsers never need to coordinate. The collision probability follows the birthday approximation for n generated IDs:
$$p \approx \frac{n^{2}}{2 \times 2^{122}}$$
Create 4 billion IDs and \(p\) is about 1.5 × 10-18, far below the odds of a hardware fault. That holds only with good entropy, so avoid Math.random() snippets. A duplicate is a non-issue in practice. Keep the random UUID generator output out of password and token roles, because a UUID is a label, not a secret, and the duplicate check only compares IDs within the current list.
Generate UUIDs in Bulk: JSON Array, CSV and SQL
When you need many IDs at once, generate UUIDs as a list and pick the layout that matches your destination. A JSON array suits test data and fixtures, a CSV column pastes straight into a spreadsheet, and a quoted comma list drops into a SQL IN (...) clause. The tool checks that every ID in the batch is distinct.
Generate UUID Values for a Database Primary Key
IDs created on any client make a strong primary key for a distributed database, because no round trip to a sequence is needed, and they are safe to expose in a public API. Store them in a native UUID or BINARY(16) column rather than a 36-character string to halve index size.
Why Random Keys Strain a B-Tree Index
Random v4 values land on arbitrary pages of a B-tree database index, causing page splits and index fragmentation on write-heavy tables. A v7 ID arrives in roughly ascending order, like a sequential integer, which is why it is the better choice for new schemas. When you need the same ID for the same input, use a v5 UUID instead, or a hash generator for content hashes.
Generate a UUID in Code: JavaScript and Python
In JavaScript, call crypto.randomUUID(). In Python, use str(uuid.uuid4()). In PostgreSQL, gen_random_uuid() returns a version 4 value with no extension.
Is a UUID v7 Private? Tokens and Special Values
A v7 ID exposes its creation time, so keep it internal and use a v4 for public links. Neither is a good session token for security purposes; for secrets use a password generator instead.
Nil UUID and Max UUID
RFC 9562 defines the nil UUID (all zeros), meaning "no value", and the max UUID (all f), a sentinel for range bounds. The inspector recognizes both as valid special values.
Frequently Asked Questions
- Which UUID version should I use?
- Version 4 (fully random) is the safe default for most uses -- no information about when or where it was generated leaks from the value itself. Version 7 is increasingly preferred for database primary keys specifically, because its embedded timestamp makes UUIDs sort chronologically and insert more efficiently into B-tree indexes than fully random v4 values. Version 1 is mostly legacy at this point -- it also embeds a timestamp, but in an older, less index-friendly layout.
- Does Version 1 leak my MAC address?
- Not with this tool -- the original UUID v1 spec used your network card's real MAC address as the 'node' component, which is a genuine privacy leak. This generator follows RFC 4122's recommended alternative instead: a cryptographically random node ID with its multicast bit set, which is indistinguishable from a real MAC address to any consumer but reveals nothing about your actual hardware.
- Are Version 7 UUIDs actually sortable?
- Yes -- the first 48 bits are a millisecond-precision Unix timestamp, so UUIDs generated later always sort after ones generated earlier when compared as plain strings or bytes. This is the entire reason v7 exists: to get the database-indexing benefits of a sequential ID while keeping the collision-resistance and decentralized generation of a UUID.
- Can two different UUIDs ever collide?
- For version 4, the chance of any collision among the 122 random bits is astronomically small -- you'd need to generate billions of UUIDs per second for centuries before a collision became likely. Version 7's timestamp reduces the random portion, but it's still generous enough (74 random bits) to make collisions practically impossible for any realistic generation rate.
- Is any of this sent to a server?
- No. Every UUID is generated entirely in your browser using the Web Crypto API's cryptographically secure random number generator -- nothing is transmitted, logged, or stored.