UUID Generator

Generate cryptographically secure UUID v4. Bulk generate, copy individually or all at once.

51f1f0e4-5e65-4dc9-bd5a-c6b0c978ebe7

Generated using crypto.randomUUID() — cryptographically secure UUID v4.

What this generator does

Every value comes from the browser's own crypto.randomUUID(), which is a cryptographically secure source — not Math.random(). Nothing is requested from a server, so the IDs you copy were never transmitted anywhere.

  • Bulk — 1, 5, 10 or 25 at once, with Copy All.
  • Uppercase — for systems that expect 550E8400-…, such as some Microsoft tooling.
  • No dashes — the 32-character hex form, for URL slugs or columns that reject hyphens.

UUID v4 format explained

A UUID is 128 bits displayed as 32 hex digits in 5 groups separated by hyphens: 8-4-4-4-12. The version (4) and variant bits are fixed; the remaining 122 bits are random.

  xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
  |        |    |    |    |
  |        |    |    |    └─ 12 random hex chars
  |        |    |    └────── variant bits (8, 9, a, or b)
  |        |    └─────────── version = 4
  |        └──────────────── 4 random hex chars
  └───────────────────────── 8 random hex chars

Example: f47ac10b-58cc-4372-a567-0e02b2c3d479

When to use UUIDs

  • Database primary keys — UUIDs let clients generate IDs before inserting rows, enable safe merging of records across databases, and avoid sequential ID leakage.
  • Session and request IDs — trace requests across microservices with a correlation ID that's guaranteed unique without a central counter.
  • File names for uploads — prevent filename collisions and path traversal by replacing user-provided names with a UUID before storing.
  • Idempotency keys — pass a UUID in payment or mutation requests so the server can detect and ignore duplicate submissions.

Generating UUIDs in code

// JavaScript / TypeScript (modern browsers + Node 14.17+)
const id = crypto.randomUUID();
// → "550e8400-e29b-41d4-a716-446655440000"

// Python
import uuid
id = str(uuid.uuid4())

// Java (17+, no dependency needed)
import java.util.UUID;
String id = UUID.randomUUID().toString();

// Java / Spring Boot entity
@Id @GeneratedValue(strategy = GenerationType.UUID)
private UUID id;

// PHP 8.3+ (or ramsey/uuid on older versions)
$id = Uuid::uuid4()->toString();

// C# / .NET
var id = Guid.NewGuid().ToString();

// Go
import "github.com/google/uuid"
id := uuid.New().String()

// PostgreSQL
SELECT gen_random_uuid();  -- built-in since v13

v1, v4 or v7 — which do you want?

This page generates v4 only, because that is what crypto.randomUUID() produces. The differences matter mostly for database indexes:

VersionBuilt fromTrade-off
v1Timestamp + MAC addressSorts by time, but leaks the host MAC
v4122 random bitsNo information leaked; random writes fragment B-tree indexes
v7Unix timestamp + randomTime-sortable without leaking hardware — the modern default for primary keys

If these IDs are going to be a primary key on a large table, v7 is usually the better choice — random v4 keys scatter inserts across the index instead of appending to the end. For API keys, idempotency tokens and file names, v4 is exactly right.

One gotcha worth knowing: crypto.randomUUID() only exists in a secure context. It works here and on any HTTPS site, but returns undefined on a plain-HTTP page.

Related Tools

Frequently Asked Questions

What is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit identifier that is unique across space and time. UUID v4 uses random numbers, making collisions extremely unlikely (1 in 2^122).

What is UUID v4?

UUID v4 is generated using random or pseudo-random numbers. The version digit is always 4. This tool uses crypto.randomUUID() which provides cryptographically secure randomness.

Can I generate multiple UUIDs at once?

Yes. Use the quantity buttons (1, 5, 10, 25) to bulk generate UUIDs. You can copy all of them at once or individually.

Is the UUID truly random?

Yes. This tool uses the Web Crypto API (crypto.randomUUID()) which provides cryptographically secure random values, the same quality used for encryption.