ToolzYard

Fast, practical, browser-based developer tools

UUID Tool • Free Online • No Signup

UUID Generator Online

Generate one or multiple UUID v4 values instantly in your browser, using the crypto.getRandomValues() CSPRNG rather than Math.random(). Below the tool, a practical guide to what a UUID actually contains, whether collisions are worth worrying about, and why v7 usually beats v4 as a database primary key.

Ready to generate UUIDs.
Fast • Free • Browser-Based

Generate UUID v4 values instantly for apps, APIs, and data workflows

UUIDs are useful when you need unique identifiers without depending on an auto-incrementing database value. This tool helps you create one or many UUID v4 values quickly for development, testing, and data generation.

✅ UUID v4 generation
✅ Single or multiple IDs
✅ Copy instantly
✅ Download list

Useful for testing and integration work

This UUID generator works directly in the browser, so you can quickly create identifiers for local development, mock payloads, fixtures, sample data, and integration testing.

For more details about site usage and analytics, read our Privacy Policy.

How to use this UUID Generator

Choose how many UUIDs you want to create, generate the result, then copy or download the list for use in your project or workflow.

  1. Enter how many UUIDs you want to generate.
  2. Click Generate.
  3. Review the generated UUID list in the output area.
  4. Copy or download the result as needed.

Example output

550e8400-e29b-41d4-a716-446655440000
9f6b2b4a-98b3-4d52-8f8e-73e4a63f8f7a
e19f0b29-2b10-4fc0-98d1-b0f3e860d2db

Common use cases

  • Database record IDs
  • API test payloads
  • Mock fixtures
  • Distributed systems
  • Seed and import data

What is a UUID, exactly?

A UUID is a 128-bit value written as 32 hexadecimal digits in five hyphen-separated groups: 8-4-4-4-12. Not all 128 bits are random. Four bits encode the version and two encode the variant, which leaves a version 4 UUID with 122 bits of randomness.

You can read the version straight off the string. The 13th hex digit is the version number, so every v4 UUID has a 4 there. The 17th digit is the variant and will be 8, 9, a, or b for the standard layout. In 550e8400-e29b-41d4-a716-446655440000 those are the 4 opening the third group and the a opening the fourth.

The current specification is RFC 9562, published in May 2024, which replaced the long-standing RFC 4122 and added versions 6, 7, and 8. Plenty of blog posts still cite RFC 4122 as current. It isn't.

Will two UUIDs ever collide?

In practice, no — but the reason is worth understanding rather than taking on faith. With 122 random bits there are roughly 5.3 × 1036 possible v4 UUIDs. By the birthday bound, you would need to generate about 2.7 quintillion (2.7 × 1018) of them before reaching a 50% chance of a single duplicate. Generate 103 trillion UUIDs and your odds of any collision are about one in a billion.

That guarantee rests entirely on the randomness being good. A v4 UUID built from Math.random() — which a lot of copy-pasted snippets still do — is not cryptographically random, and its real collision resistance is far worse than the math above suggests. Use a CSPRNG: crypto.randomUUID() in browsers and Node, uuid.uuid4() in Python, uuid_generate_v4() in Postgres.

One gotcha that bites people on local networks: crypto.randomUUID() only exists in a secure context. It works on HTTPS and on localhost, but it is undefined if you load your dev server over plain HTTP at, say, http://192.168.1.20:3000. The failure looks like a missing function, not a security error, which sends people down the wrong debugging path.

UUID v4 or UUID v7 for a database key?

This is the decision that actually matters, and v4 is usually the wrong answer for a primary key.

A v4 UUID is uniformly random, so consecutive inserts land in unrelated places in the index. In MySQL's InnoDB the primary key is the clustered index — the table is physically stored in primary key order — so random keys force the engine to insert into the middle of pages it has to fetch and split, instead of appending to the tail. Write throughput drops, pages end up half-full, and your buffer pool churns because the hot set is the whole index rather than its right edge. PostgreSQL is less severe since its tables are heaps, but its B-tree index still loses the cache locality a sequential key gives you.

UUID v7 fixes this. It puts a 48-bit Unix millisecond timestamp in the leading bits and fills the rest with randomness, so v7 values generated over time sort in roughly creation order. Inserts append near the right edge of the index like an auto-increment key, while you keep the ability to generate IDs on any client without coordinating with the database. It is the same 128-bit format, so it drops into any column that already holds a UUID.

The trade-off is that v7 deliberately leaks creation time — anyone holding the ID can read the millisecond it was minted. For a row ID that is almost always fine and often useful. For an ID you hand to untrusted users where creation time is sensitive, stay with v4. (ULID solves the same ordering problem and predates v7, but now that v7 is standardised there is little reason to reach for a non-RFC format.)

Storing UUIDs without wasting space

The most common and most expensive mistake is storing a UUID as CHAR(36). That is the hyphenated text form: 36 bytes to hold 16 bytes of information, plus a character-set collation on every comparison.

In PostgreSQL use the native uuid type, which stores 16 bytes. In MySQL use BINARY(16) and convert at the boundary with UUID_TO_BIN() and BIN_TO_UUID(). The saving compounds: InnoDB appends the primary key to every secondary index, so a 20-byte-per-row overhead multiplies across each index on the table.

Two smaller details. UUIDs are canonically written lowercase, but the spec says to accept either case on input — so compare them case-insensitively, or normalise before storing. And the all-zero value 00000000-0000-0000-0000-000000000000 is the reserved nil UUID; it is a legal UUID and a terrible sentinel, because it is exactly what an uninitialised struct serialises to. A nil UUID in production data usually means a bug, not a value.

Should a UUID ever be a secret?

A v4 UUID from a CSPRNG carries 122 bits of entropy, which is more than enough to resist guessing — a password reset token needs about 128 bits and this is close. So the entropy is not the problem. The handling is.

UUIDs are treated as identifiers throughout most stacks, which means they end up in URL paths, access logs, Referer headers, analytics pipelines, and error reports. None of that infrastructure is built to protect a secret. If you need a bearer token, generate one explicitly, mark it as sensitive, and give it an expiry. Do not promote an identifier into a credential just because it happens to be unguessable.

Also worth knowing: this concern does not apply uniformly across versions. UUID v1 derives part of its value from the host's MAC address and a timestamp, so v1 values can disclose which machine generated them and when. If you have inherited v1 IDs in a public-facing API, that is a real leak worth auditing.

Frequently Asked Questions

What UUID version does this generate?

Version 4 — 122 random bits drawn from your browser's crypto.getRandomValues() CSPRNG, not Math.random().

Should I use UUID v4 or v7 for my primary key?

Prefer v7. Its time-ordered prefix keeps inserts at the right edge of the index, avoiding the page splits and buffer-pool churn that random v4 keys cause in clustered-index engines like InnoDB. Choose v4 only when the ID is exposed to untrusted parties and its creation time must stay private.

How should I store a UUID in MySQL or PostgreSQL?

PostgreSQL has a native 16-byte uuid type — use it. In MySQL use BINARY(16) with UUID_TO_BIN() and BIN_TO_UUID(). Avoid CHAR(36), which spends 36 bytes storing 16 bytes of data and inflates every secondary index on the table.

Can two UUIDs be the same?

Only at scales no real system reaches. You would need roughly 2.7 quintillion v4 UUIDs for a 50% chance of one duplicate. The practical risk is not the math but a weak random source — a UUID built from Math.random() loses that guarantee entirely.

Why is crypto.randomUUID() undefined in my app?

It requires a secure context. It is available over HTTPS and on localhost, but not when a dev server is reached over plain HTTP at a LAN address such as http://192.168.1.20:3000. Serve over HTTPS or use localhost.

Is a UUID safe to use as a session or reset token?

Entropy-wise a CSPRNG-generated v4 is strong enough, but UUIDs leak into URLs, logs, and Referer headers because everything treats them as identifiers rather than secrets. Generate a purpose-built token with an expiry instead.