DevKits

UUID Generator

Generate random UUIDs (v4) and time-ordered UUIDs (v7) online. Bulk generate up to 1000 at once and copy with one click.

Last updated:

Comments

Click Generate to create a random UUID v4 or a time-ordered UUID v7. Bulk generate up to 1,000 at once — everything runs locally.

  • 971ff2fb-f530-401f-9d72-9fe71e576374
  • 74dcab0e-1c49-49f0-906c-190c1f3ecda5
  • c15fd549-dc16-4ce5-92e4-5fb0156532f2
  • 411e7184-2c03-449f-adb1-1fa4f5851b75
  • dc3066e0-1474-4b86-b15f-266e517f89e4

What is UUID Generator?

A UUID (Universally Unique Identifier), also called a GUID, is a 128-bit identifier that can be generated on any machine without coordination and be effectively guaranteed unique. UUIDs are the go-to primary key for distributed systems, event ids, upload names, and anything that needs a unique id without a central sequence.

How to generate UUIDs online

  1. 1Pick the UUID version: v4 (random) or v7 (time-ordered, RFC 9562).
  2. 2Choose how many UUIDs to generate (1 to 1000).
  3. 3Click Generate — the list appears instantly.
  4. 4Click Copy on any row to grab a single UUID, or Copy All to copy the whole list.

Use Cases

Database primary keys

Prefer UUID v7 over v4 as a primary key — v7 embeds a timestamp, so rows are inserted in order and B-tree indexes stay compact.

Idempotency keys

APIs like Stripe and Shopify use client-generated UUIDs as idempotency keys, so retries never charge twice.

File upload names

Rename user uploads to a UUID before saving — avoids collisions, path traversal, and information leakage from original filenames.

Correlation / trace IDs

Attach a UUID to a request at the edge and propagate it across microservices to stitch logs into a single trace.

Code Examples

UUID v4 in the browser (native)

// Modern browsers & Node 19+
const id = crypto.randomUUID();

UUID v7 in Node.js

// npm i uuid
import { v7 as uuidv7 } from "uuid";
const id = uuidv7();

UUID in Python

import uuid
print(uuid.uuid4())            # random
# uuid7 not in stdlib yet; use uuid7 package

UUID in Go

import "github.com/google/uuid"

id := uuid.New()               // v4
// For v7: github.com/gofrs/uuid/v5

UUID in SQL

-- PostgreSQL
SELECT gen_random_uuid();      -- v4
-- MySQL 8+
SELECT UUID();

Key Concepts

UUID v4
Fully random 128-bit id (122 bits of entropy). Collision probability is essentially zero even at billions of IDs.
UUID v7 (RFC 9562)
First 48 bits are a Unix millisecond timestamp, rest is random. Sortable by creation time — ideal as a database primary key.
ULID
A UUID-compatible 128-bit id with millisecond timestamp + randomness, but encoded in Crockford Base32 (26 chars, no dashes). UUID v7 largely obsoletes ULID.
NanoID
Shorter (21 chars) alternative for URLs, using a custom alphabet. Not a UUID and not sortable, but URL-friendly.

Tips & Best Practices

  • For new databases: prefer UUID v7 over v4. It's monotonic, indexes better, and reveals no more information than v4 does (still random after the timestamp).
  • Store UUIDs as `uuid` type (Postgres) or `BINARY(16)` (MySQL). Storing as `VARCHAR(36)` doubles storage and slows every index scan.
  • Never expose sequential integer IDs in URLs if enumeration is a risk. UUIDs are effectively unguessable.
  • For very high-write workloads, UUID v7 also helps avoid the 'random insert' write-amplification problem that plagues v4 primary keys.

Frequently Asked Questions

What is the difference between UUID v4 and v7?

UUID v4 is fully random. UUID v7 embeds a Unix millisecond timestamp in the first bits, making it time-ordered and much more efficient as a database primary key.

Can I generate UUIDs in bulk?

Yes. Set the count and generate up to 1000 UUIDs at once, then copy them all with one click. Everything is generated locally in your browser — nothing is sent to a server.

Are these UUIDs cryptographically secure?

Yes. The random bytes come from the browser's crypto.getRandomValues, which is a cryptographically secure pseudo-random number generator.

Try Next

UUID v7 Generator

Generate UUID v7 identifiers online (RFC 9562). The first 48 bits encode a Unix millisecond timestamp, so v7 UUIDs sort lexicographically by creation time — dramatically better as a database primary key than v4. Bulk generate up to 1000 and inspect the embedded timestamp for each. 100% local.

Related Tools

Reference & Guides