← Back to Tools

UUID Generator

Generate random UUIDs (v4) instantly.

UUIDs to generate

How to use the UUID Generator

Generate one UUID or a batch of up to 1000 in a single click. Each UUID is cryptographically random and universally unique — safe to use as a database key, session ID, or filename.

  1. 1

    Set the count

    Enter how many UUIDs you need, from 1 to 1000. Leave it at 1 to generate a single UUID, or increase the count for batch operations — seeding a database, generating test fixtures, or populating a migration script.

  2. 2

    Click Generate

    Each UUID is generated using the browser's cryptographic random number generator (crypto.getRandomValues), producing a v4 UUID in the standard xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx format. No two generated UUIDs will ever be the same.

  3. 3

    Copy the output

    Click Copy Output to copy all generated UUIDs to your clipboard. Each UUID appears on its own line, ready to paste into SQL scripts, JSON arrays, code files, or spreadsheets.

Frequently asked questions

What is a UUID?

A UUID (Universally Unique Identifier), also known as a GUID (Globally Unique Identifier), is a 128-bit identifier formatted as 32 hexadecimal digits in five groups separated by hyphens: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. The format is defined in RFC 4122. UUIDs are designed to be unique across time and space without requiring a central authority to assign them.

What is the difference between UUID v1, v3, v4, and v5?

v1 is generated from the current timestamp and the machine's MAC address — unique, but leaks machine identity and creation time. v3 and v5 are deterministic: they hash a namespace and a name (v3 uses MD5, v5 uses SHA-1) to produce the same UUID for the same input every time — useful for content addressing. v4 is purely random — 122 bits of randomness — and the most widely used type for general-purpose IDs.

Are v4 UUIDs truly unique?

In practice, yes. A v4 UUID has 2¹²² (about 5.3 × 10³⁶) possible values. The probability of generating two identical v4 UUIDs in a billion UUID-per-second system is essentially zero for the lifetime of the universe. Collisions are theoretically possible but statistically irrelevant at any realistic scale.

Are UUIDs safe to use as database primary keys?

Yes, with one caveat. UUIDs are excellent as primary keys because they can be generated on the client without a database round-trip, they don't expose sequential IDs to users, and they work across distributed systems. The caveat: random UUIDs (v4) cause index fragmentation in B-tree indexes because inserts happen at random positions. For high-insert databases, consider UUID v7 (time-ordered, sequential) or ULID which avoids this issue while remaining unique.

What is UUID v7 and when should I use it?

UUID v7 is a newer standard that encodes a millisecond-precision Unix timestamp into the first 48 bits, making the UUID naturally sortable by creation time. This eliminates the index fragmentation problem of v4 in sequential-write databases like PostgreSQL and MySQL. If you're choosing a UUID type for a new database schema in 2025 and beyond, v7 is the recommended choice over v4.

Can I use a UUID as a filename?

Yes. A UUID contains only hexadecimal characters (a–f, 0–9) and hyphens, making it safe for filenames on all operating systems. A common pattern is to use a UUID as a filename for user-uploaded files — 3f2504e0-4f89-11d3-9a0c-0305e82c3301.jpg — to prevent filename collisions and avoid exposing the original filename in the URL.

How is this tool different from crypto.randomUUID()?

They produce the same result. This tool calls the same browser API (crypto.getRandomValues) that modern browsers expose as crypto.randomUUID(). The tool simply provides a convenient UI for generating and copying one or many UUIDs without writing any code. If you're working in a script or terminal, node -e "console.log(crypto.randomUUID())" or uuidgen on macOS/Linux are equally fast.