Ttooleras
🆔

UUID Generator

Generators

Generate UUID v4, v1, v7 and GUIDs — bulk or single, instantly. Free, private — all processing in your browser.

Click "Generate" to create UUIDs
Advertisement

A UUID is a 128-bit identifier you can generate anywhere — on a phone, a server, ten machines at once — without a central authority handing out numbers, and still be effectively certain no two will ever collide. This generator makes them one at a time or in bulk (up to 100), in the format you need: uppercase, no dashes, or wrapped in braces. It also has a validate tab that checks a UUID and tells you which version it is.

Two versions are offered because they solve different problems. v4 is pure random — the default, right for most IDs. v7 puts a timestamp at the front so the IDs sort by creation time, which matters a lot when they're database primary keys. Everything is generated locally with your browser's cryptographic random source.

Features at a glance

UUID v4 (random) — the default

The most common UUID type. 122 random bits, collision probability near zero. Use it for primary keys, session IDs, correlation IDs, and any unique identifier that does not need ordering.

UUID v1 (timestamp + MAC)

Legacy format that includes a timestamp and node (MAC) identifier. Sequential but leaks MAC address. Mostly kept for backward compatibility.

UUID v7 (sortable, RFC 9562)

The new standard for databases. Millisecond Unix timestamp + random bits — lexicographically sortable by time. Dramatically improves B-tree index performance over v4.

Bulk generation

Generate up to 1,000 UUIDs at once. Export as plain text, JSON array, SQL INSERT statements, or CSV. Perfect for seeding test data.

Multiple output formats

Lowercase (standard), uppercase, with braces (Microsoft GUID format), or without hyphens (compact 32-character hex). Copy whichever format your system expects.

Instant generation in browser

No server round-trip. Uses Web Crypto API for cryptographic randomness. Works offline once the page is loaded.

Copy and download

Copy to clipboard with one click or download as .txt, .json, or .csv. Great for database migrations and large test fixtures.

Built-in validation

Paste any string to verify if it is a valid UUID and identify which version it is. Useful when debugging API responses or log entries.

Step by step

  1. 1

    Choose UUID version

    Select v4 for general use (99% of cases), v7 for database primary keys that need sorting, v1 for legacy systems that require it.

  2. 2

    Choose quantity

    Generate a single UUID or up to 1,000 at once for bulk scenarios like test data seeding or batch provisioning.

  3. 3

    Pick output format

    Standard lowercase hyphenated form, uppercase, with-braces GUID (for .NET / Windows), or compact 32-char hex.

  4. 4

    Click Generate

    UUIDs appear instantly. Each run produces completely different values (v4, v7) or sequential time-ordered values (v1, v7).

  5. 5

    Copy, download, or use in code

    Copy single UUIDs with the Copy button, or download bulk output as text/JSON/CSV for database imports.

When to use the UUID Generator

Database design

  • Primary keys: UUID primary keys let you generate IDs on the client or in serverless functions, then insert them into the database without round-tripping to fetch an auto-increment ID.
  • Distributed systems: In microservices, each service can generate its own UUIDs without coordination. No central ID service needed.
  • Database merging: When consolidating data from multiple databases, UUIDs guarantee no primary key collisions.
  • Sharded databases: Sharding by UUID prefix works cleanly — no hot shards like you get with sequential IDs.

APIs and services

  • Correlation IDs for tracing: Attach a UUID to every incoming request. Include it in logs across all services for distributed tracing (OpenTelemetry, Datadog, Honeycomb).
  • Idempotency keys: Clients send a UUID with mutating API calls. Server deduplicates by UUID, preventing duplicate charges or actions on retry.
  • Session and token IDs: Use UUIDs for session identifiers, refresh tokens, or any opaque unique identifier exposed to clients.
  • Webhook and event IDs: Give every outbound webhook a UUID so consumers can deduplicate and trace events.

Testing and development

  • Test fixtures: Generate unique test user IDs, order IDs, and resource identifiers that will not collide with production data.
  • Database seeding: Bulk-generate UUIDs and insert them as part of migration scripts or seed files.
  • Load testing: Generate unique identifiers for each synthetic user or request in performance tests.

Mobile and offline apps

  • Offline-first synchronization: Mobile apps generate UUIDs locally so users can create records offline. When the app reconnects, records sync without ID conflicts.
  • Device identifiers: Use UUIDs as anonymous device or install IDs instead of MAC addresses or personal data.

UUID Generator — examples

UUID v4 (random)

The default. 122 bits of randomness.

Input
Click Generate
Output
550e8400-e29b-41d4-a716-446655440000

UUID v7 (sortable)

Timestamp prefix makes it sortable by creation time. Generated 2 seconds apart, in order.

Input
Generate 2 UUIDs v7
Output
018fc4b3-4a8f-7123-a9c7-41d265e0e54c
018fc4b3-4ab2-7e4a-8a34-c2b0a7e61fb0

Bulk generate 5 v4 UUIDs

Common for test fixtures and database seeding.

Input
Quantity: 5, version: 4
Output
4f2a1b78-6c5e-4fd1-9b23-88e3a4c9f21d
7d9e3a6f-2b45-48c1-b8d6-5c91f3a2b7e8
1c8a6d4f-9e73-42b5-a8fc-2e5d9b07c3a1
3b7f9e2d-8c14-4f6a-91b8-6d3e0a5c8f74
9a4e6d2f-5b83-41c7-bd54-7c2a9f3b6e18

SQL INSERT with UUIDs

Ready-to-paste SQL for seeding a database.

Input
Output format: SQL
Output
INSERT INTO users (id, name) VALUES
('4f2a1b78-6c5e-4fd1-9b23-88e3a4c9f21d', 'Alice'),
('7d9e3a6f-2b45-48c1-b8d6-5c91f3a2b7e8', 'Bob'),
('1c8a6d4f-9e73-42b5-a8fc-2e5d9b07c3a1', 'Carol');

Microsoft GUID (with braces)

Windows/.NET GUID format wraps in braces.

Input
Format: braces
Output
{550e8400-e29b-41d4-a716-446655440000}

Compact (no hyphens)

32-character hex string without separators, used in some APIs and URLs.

Input
Format: no hyphens
Output
550e8400e29b41d4a716446655440000

Technical details

v4 (random). 122 of the 128 bits are random (the other 6 are fixed version/variant markers). The collision math is the reassuring part: you'd need to generate roughly a billion UUIDs per second for about 85 years to have a 50% chance of a single collision. In practice, treat them as unique. This tool uses crypto.randomUUID(), backed by the OS cryptographic RNG — not Math.random().

v7 (time-ordered). The first 48 bits are a Unix millisecond timestamp, the rest random. Because the timestamp leads, v7 values sort chronologically as plain strings. That single property makes them far better than v4 as database primary keys: random v4 keys scatter inserts all over a B-tree index (page splits, cache misses), while v7 keys append in order, keeping the index tight and inserts fast.

Anatomy. xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx — the M nibble is the version (4 or 7), and the top bits of N are the variant. The validator here reads exactly those bits to report the version.

Case and format. UUIDs are case-insensitive; A1B2 and a1b2 are the same value. Hyphens are cosmetic — some systems store the 32 hex chars without them.

Common problems and solutions

Using random v4 UUIDs as database primary keys

Random keys scatter inserts across the index, causing page splits and slower writes as the table grows. Use v7 (time-ordered) for primary keys — it keeps inserts sequential and the index compact.

Assuming a UUID is a secret

v4 is unguessable in practice, but UUIDs are routinely logged, put in URLs, and returned in APIs. Don't rely on one as a security token for password resets or access — use a dedicated secret.

Case-sensitive comparison

UUIDs are case-insensitive. Comparing them as case-sensitive strings can produce false mismatches. Normalize case (usually lowercase) before comparing or storing.

Expecting v4 to be sortable

v4 has no time component, so sorting v4 UUIDs is meaningless order. If you need chronological order, generate v7.

Generating with Math.random()

Some libraries fake UUIDs with Math.random(), which isn't uniform or unpredictable and can collide. This tool uses the browser's cryptographic RNG; prefer crypto-based generation everywhere.

How it compares

v4 vs v7. Use v4 for general-purpose IDs where order doesn't matter. Use v7 when the ID is a database primary key or anything you'll sort or range-scan by time — the index-locality win is real and measurable at scale.

UUID vs auto-increment integer. Integers are smaller and naturally ordered but require a central sequence (a problem across shards or offline clients) and leak row counts/creation order to anyone who sees them. UUIDs generate anywhere and reveal nothing — at the cost of 16 bytes instead of 4–8.

UUID vs ULID / nanoid. ULID is essentially the same idea as v7 (time-sortable) with a shorter, case-insensitive text encoding. nanoid is a compact random string for URLs when you don't need the UUID format. If you specifically need the standard UUID shape (databases, RFC-based APIs), use these.

Are they secure tokens? v4 is random enough to be hard to guess, but "hard to guess" isn't the same as "designed as a secret." For session tokens or password resets, use a purpose-built secret generator, not a UUID you might also log or expose.

Questions and answers

What is the difference between v4 and v7?

v4 is fully random — the general-purpose default. v7 prefixes a millisecond timestamp so the IDs sort by creation time, which makes them much better as database primary keys. Pick v4 unless you care about ordering.

Can two UUIDs ever be the same?

In theory yes, in practice no. A v4 UUID has 122 random bits; the odds of a collision are so low you can safely treat every one as unique across all your systems and time.

Are these UUIDs cryptographically random?

Yes. Generation uses your browser's crypto.randomUUID / getRandomValues, backed by the operating system's secure RNG — not the predictable Math.random().

Is anything sent to a server?

No. UUIDs are generated entirely in your browser. You can generate a hundred of them offline.

Which version should I use for a database primary key?

v7. Its time-ordered layout keeps inserts sequential in the index, avoiding the write slowdown that random v4 keys cause as a table grows.

Do uppercase, dashes, or braces change the value?

No — those are just formatting. A UUID is case-insensitive and the dashes/braces are cosmetic. abc... equals ABC...; {uuid} is the same id as uuid.

Additional resources

Advertisement

Related tools

All Generators

Learn more

Explore more tools

200+ free tools that run in your browser.

Browse all tools →