UUID generator
Pick v1 or v4, choose how many you need, and copy your UUIDs instantly. All generation happens in your browser.
About this tool
A UUID is a 128-bit identifier you can generate anywhere without coordinating with anyone. That is the whole point: two services, two devices, or two engineers can mint identifiers simultaneously and offline, and the chance of a collision is negligible. This is what makes UUIDs the default for distributed systems, offline-first clients that create records before syncing, and any schema where an auto-incrementing integer would leak how many rows you have or require a round trip to the database before you know an object's identity. The versions differ in how the bits are filled. Version 4 is almost entirely random and is the right default. Version 1 embeds a timestamp and the host's MAC address, which makes it sortable but leaks hardware identity and creation time. Version 7, standardised in RFC 9562, puts a Unix millisecond timestamp in the high bits and randomness in the rest — sortable by creation order without leaking hardware, which makes it markedly kinder to database indexes than v4. This tool generates v1, v4, and v7, singly or in bulk, using the browser's cryptographic random source.
- 1
Select the UUID version: v4 (random, most common), v1 (timestamp-based), or v7 (sortable timestamp).
- 2
Click Generate — or use the bulk option to generate multiple UUIDs at once.
- 3
Click Copy to copy the UUID to your clipboard.
Generate UUIDs for database primary keys, API resources, or idempotency tokens.
Create a batch of UUIDs for seeding test data or fixtures.
Get a v1 UUID when you need a time-ordered, sortable identifier.
UUID v4 (random)
Version: v4550e8400-e29b-41d4-a716-446655440000UUID v1 (timestamp)
Version: v16ba7b810-9dad-11d1-80b4-00c04fd430c8Database index performance degrades after switching to UUID primary keys
Cause: Random v4 UUIDs insert at arbitrary points in a B-tree index, fragmenting pages and destroying the locality that sequential integer keys provide. On InnoDB, where the primary key determines physical row order, the effect on write throughput is substantial.
Fix: Use v7, which is time-ordered, so new rows append rather than scatter. Store UUIDs as 16 binary bytes rather than a 36-character string — the text form more than doubles index size.
Version 1 UUIDs are flagged in a security review
Cause: A v1 UUID encodes the generating machine's MAC address and the exact time of creation. Exposing one publicly discloses both, and the low randomness makes neighbouring identifiers guessable.
Fix: Never use v1 for anything user-facing, for session tokens, or for unguessable URLs. Use v4 or v7 for identifiers, and a dedicated cryptographic token rather than any UUID for security-sensitive values.
Comparing UUIDs fails even though they look the same
Cause: The text form is not canonical. Case varies between systems, and some emit UUIDs with braces or without hyphens.
Fix: Normalise to lowercase and strip braces before comparing, or compare the 16 underlying bytes. Most database UUID types handle this for you; string columns do not.
These answers explain common uuid generator tasks, expected input formats, and edge cases so both visitors and search engines can understand what this tool does.
What is the difference between UUID v1 and v4?
UUID v1 is time-based — it encodes the current timestamp and a node identifier, making it sortable by creation time. UUID v4 is randomly generated and has no meaningful structure, making it better for privacy.
Is a UUID truly unique?
UUID v4 has 122 random bits, giving 2¹²² possible values. The probability of a collision is astronomically small — effectively unique for all practical purposes.
What is a GUID?
GUID (Globally Unique Identifier) is Microsoft's term for UUID. They use the same format and are interchangeable.
Can I generate multiple UUIDs at once?
Yes. Set the count field to any number from 1 to 100 and click Generate. All UUIDs are shown in the output area and can be copied together with the Copy all button.
Is UUID v4 safe to use as a database primary key?
Yes, but with a trade-off. UUID v4 is random, so it does not sort chronologically. This can cause index fragmentation in databases that prefer sequential keys. If insert-time ordering matters, consider UUID v1 (time-based) or a ULID instead.
Node.js 14.17+ and all modern browsers include crypto.randomUUID(). For older environments use the uuid package.
// Built-in — no dependencies needed
const id = crypto.randomUUID();
console.log(id); // e.g. "110e8400-e29b-41d4-a716-446655440000"
// Multiple UUIDs
const ids = Array.from({ length: 5 }, () => crypto.randomUUID());See full JavaScript / Node.js examples →