UUID Generator — Online & Free

Need to generate a UUID quickly? This guide covers what UUIDs are, the different UUID versions, how to generate them online in bulk, and how to generate UUIDs in your own code.

Free Online UUID Generator

Generate v4 UUIDs in bulk. Copy single or all. Runs entirely in your browser — instant.

Open UUID Generator →

What is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit identifier designed to be globally unique without requiring a central authority to assign them. The format is 32 hexadecimal digits displayed in 5 groups separated by hyphens: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.

Example UUID v4
550e8400-e29b-41d4-a716-446655440000

UUIDs are used as primary keys in databases, identifiers in APIs, file names, session IDs, and anywhere you need a unique identifier that can be generated without coordination between systems.

UUID versions explained

VersionHow generatedUse case
v1Timestamp + MAC addressSortable but leaks machine info — avoid
v3MD5 hash of namespace + nameDeterministic IDs from a name
v4Random (122 bits of randomness)Most common — use this for general purposes
v5SHA-1 hash of namespace + nameDeterministic IDs (better than v3)
v7Timestamp + random (RFC 9562)Sortable + random — best for databases

For most use cases — database primary keys, API identifiers, session tokens — UUID v4 is the right choice. It's random, collision-resistant, and universally supported.

How to generate UUIDs online

  1. Open the UUID generator on tinybench.dev
  2. Set how many UUIDs you want (1 to 100)
  3. Click Generate
  4. Copy a single UUID or copy all at once

Every UUID is generated using crypto.randomUUID() or a cryptographically secure random number generator in your browser — not on a server.

Generate UUIDs in code

JavaScript (browser)
// Built-in — no library needed (modern browsers + Node 15+)
const uuid = crypto.randomUUID();
// "550e8400-e29b-41d4-a716-446655440000"
Python
import uuid

# Generate a single UUID v4
uid = str(uuid.uuid4())
print(uid)  # "550e8400-e29b-41d4-a716-446655440000"

# Generate 10 UUIDs
uuids = [str(uuid.uuid4()) for _ in range(10)]
PostgreSQL
-- Generate a UUID
SELECT gen_random_uuid();

-- Use UUID as primary key
CREATE TABLE users (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  name TEXT NOT NULL
);
MySQL
-- Generate a UUID
SELECT UUID();

-- As default primary key value
CREATE TABLE users (
  id CHAR(36) PRIMARY KEY DEFAULT (UUID()),
  name VARCHAR(255) NOT NULL
);

UUID as a database primary key

UUIDs are popular as primary keys because they can be generated anywhere — on the client, in a microservice, or in the database — without needing to query a sequence or auto-increment counter. This is valuable in distributed systems.

Trade-offs to be aware of:

Frequently asked questions

Are UUIDs truly unique?
Practically yes. A UUID v4 has 122 bits of randomness. Generating 1 billion UUIDs per second for 100 years gives a collision probability of approximately 50% — meaning you'd need to generate an incomprehensible number of UUIDs before a collision becomes likely. For any realistic use case, treat them as unique.
Should I use uppercase or lowercase UUIDs?
The UUID specification (RFC 4122) recommends lowercase hex digits. Most systems treat UUIDs as case-insensitive, but lowercase is the dominant convention and what most libraries generate by default.
Can I use a UUID as a URL slug?
Yes — UUIDs only contain hex digits (0-9, a-f) and hyphens, all of which are URL-safe. However they're verbose. If URL readability matters, consider a shorter ID format like NanoID or a ULID.
What is a nil UUID?
The nil UUID is all zeros: 00000000-0000-0000-0000-000000000000. It's used as a placeholder or default value representing "no UUID" — similar to null but in UUID form.

Try it now — free & private

Runs entirely in your browser. No sign-up, no uploads, no tracking.

Open UUID Generator →

Related tools on tinybench.dev