plato·uuid
Open DevTools → Network and click Generate. You will see zero outbound requests from the tool. All UUID/ULID generation runs locally using crypto.getRandomValues(). View source on GitHub.

UUID Generator

Generate UUID v4, v7, v1, v3, v5, v6, ULID, and NanoID. Decode any UUID to see version, timestamp, and variant bits. Bulk generate 1–1000 at once. Everything runs in your browser.

Paste two time-ordered IDs (UUID v1, v6, v7, or ULID) to see which was created first.

How to use

  1. Generate: choose a type (v4 is the safe default; v7 for databases), set count 1–1000, click Generate. Copy all or export as JSON or code.
  2. Decode: paste any UUID or ULID — the tool shows version, variant, embedded timestamp (for v1/v6/v7/ULID), and RFC validity.
  3. Compare: paste two time-ordered IDs side-by-side to see which is older.

Frequently asked questions

What is the difference between UUID v4 and v7?

UUID v4 is randomly generated — all 122 bits are random, making it unpredictable but unsortable. UUID v7 encodes a 48-bit millisecond timestamp in the high bits, so v7 UUIDs sort chronologically as strings. For database primary keys, v7 dramatically reduces B-tree fragmentation compared to v4.

Why is UUIDv7 better for database primary keys?

Random v4 UUIDs insert into random positions in a B-tree index, causing frequent page splits and cache thrashing at scale. v7 UUIDs always sort after existing ones (monotonically increasing), so inserts append to the right end of the index — identical access pattern to auto-increment, but globally unique. PostgreSQL 17 and MySQL 8.4 recommend v7 as the default UUID type.

What is a ULID and how does it differ from a UUID?

A ULID is a 128-bit identifier encoded as 26 Crockford Base32 characters (no dashes, URL-safe). Like UUIDv7, the first 48 bits are a millisecond timestamp. ULIDs and UUIDv7 are functionally equivalent for most use cases — choose ULID if you prefer a shorter, dash-free string; choose UUIDv7 for maximum database compatibility.

Are UUIDs from this site cryptographically secure?

Yes. This tool uses crypto.getRandomValues() and crypto.randomUUID() from the Web Crypto API — a CSPRNG with the same security bar as OpenSSL or /dev/urandom. You can safely use these UUIDs as session tokens, unguessable IDs, or API keys.

Can a UUID collide? What are the odds?

With 122 random bits, you would need to generate approximately 2.71 quintillion UUID v4s before reaching a 50% chance of a single collision. At one billion per second that would take 86 years. UUID collisions from a proper CSPRNG are not a realistic operational concern.

What is the variant field in a UUID?

The variant field (bits 64–65) identifies the UUID layout. Variant 10 (binary) means RFC 4122 / IETF UUID — the standard you almost always want. Variant 110 is Microsoft GUID (NCS legacy). All UUIDs generated here are RFC 4122 compliant, which the Decode tab verifies.

How do I generate a UUID in Python, Go, Rust, or SQL?

Python: import uuid; str(uuid.uuid4()). Go: github.com/google/uuiduuid.New().String(). Rust: uuid crate — Uuid::new_v4().to_string(). Node.js: built-in crypto.randomUUID(). PostgreSQL 13+: gen_random_uuid(). PostgreSQL 17+: uuidv7(). The Copy as Code dropdown above generates ready-to-paste snippets.

What is the difference between UUID v1 and v6?

Both embed a timestamp and node ID (MAC address). v1 stores timestamp bytes in fragmented order (low, mid, high) for DCE RPC compatibility — not lexicographically sortable. v6 reorders the bytes so they sort correctly as strings. For new systems, prefer v7 (simpler, no MAC address in the ID).

What is NanoID and why is it shorter?

NanoID generates a random string from a URL-safe alphabet (A-Za-z0-9_-). The default 21-character length gives ~126 bits of entropy — comparable to UUID v4 but 42% shorter as a string (21 chars vs 36 with dashes). It is not time-ordered and has no version bits, making it best for URLs, filenames, and display IDs where sortability is not needed.

How does this page generate UUIDs without a server?

All generation runs in JavaScript inside your browser tab. Open DevTools → Network, then click Generate — you will see zero outbound requests from the tool. The page works offline once loaded. All random bits come from crypto.getRandomValues() which is built into every modern browser.

Examples

UUID v7 as a PostgreSQL primary key

Time-ordered UUIDs prevent B-tree fragmentation on insert-heavy tables.

-- PostgreSQL 17+
CREATE TABLE events (
  id UUID PRIMARY KEY DEFAULT uuidv7(),
  name TEXT NOT NULL,
  created_at TIMESTAMPTZ DEFAULT now()
);
-- id column is sortable by creation time

UUID v4 in Node.js (no package needed)

Since Node.js 15.6, crypto.randomUUID() is built in — no uuid package required.

// Node.js 15.6+ / modern browsers
import { randomUUID } from 'crypto';

const id = randomUUID();
// "f47ac10b-58cc-4372-a567-0e02b2c3d479"

// or in browser JS
const id2 = crypto.randomUUID();

ULID for a sortable slug

ULIDs are URL-safe, dash-free, and sort chronologically — great for public-facing IDs.

-- ULID: 01HXYZ3KABC4DEF5GHJ6KMN7PQ
-- First 10 chars = millisecond timestamp
-- Last 16 chars = random

-- Use as a URL slug:
-- /posts/01HXYZ3KABC4DEF5GHJ6KMN7PQ
-- Route sorts correctly by age

About UUID privacy and browser-side generation

UUID stands for Universally Unique Identifier, defined in RFC 4122 (and updated in RFC 9562 which added v6, v7, and v8). A UUID is a 128-bit value typically displayed as 32 hexadecimal digits separated by hyphens in the form xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx, where M encodes the version and N encodes the variant.

Version 4 (most common) fills 122 of those 128 bits with cryptographically random data, with 6 bits reserved for version and variant. It is stateless, requires no coordination, and is safe to generate client-side. The collision probability across all of human history at current compute rates remains effectively zero.

Version 7 (recommended for databases since 2024) places a 48-bit Unix millisecond timestamp in bits 0–47, a 4-bit version, 12 bits of sub-millisecond precision or sequence counter, a 2-bit variant, and 62 random bits. The result is monotonically increasing within a millisecond — identical to auto-increment for B-tree purposes, but globally unique and safe to generate on any client without coordination.

ULID (Universally Unique Lexicographically Sortable Identifier) achieves the same goal as UUIDv7 with a different encoding: 26 Crockford Base32 characters, case-insensitive, URL-safe, with no dashes. The spec guarantees monotonicity within a millisecond by incrementing the random bits if multiple ULIDs are generated in the same millisecond.

Privacy: UUID v1 and v6 embed the generating machine's MAC address in the node field — a subtle privacy leak that UUIDv7 eliminates (it uses random bits for the equivalent field). This tool generates v1/v6 UUIDs with a random node ID rather than your real MAC address, so the output is RFC-compliant but does not expose your network hardware identity.

All IDs generated here use crypto.getRandomValues(), which is the same CSPRNG used by your OS's /dev/urandom and by TLS. No data is sent to any server at any point. You can verify this by running the tool with DevTools → Network open: zero requests appear.