X Xerobit

UUID Generator

Generate UUID v4 (random) or v7 (time-sorted, the modern choice for database primary keys). Bulk export as JSON array, CSV, or SQL VALUES. Up to 10,000 at once — 100% client-side.

Ready. Click Generate.

How to generate a UUID

  1. Select a version — choose v4 for a purely random UUID or v7 for a time-sorted UUID suited to database primary keys.
  2. Generate — click Generate (or set a count up to 10,000 and generate in bulk). Each UUID is created using your browser's cryptographically secure random number generator — no server involved.
  3. Copy — click Copy All to grab every UUID, or export as a JSON array, CSV, or SQL VALUES clause and paste directly into your code or database seed script.

UUID v4 vs v7 — which to use in 2026

v4 is 122 bits of pure randomness plus 6 version/variant bits — no timestamp component whatsoever. That makes it ideal for user IDs, session tokens, API keys, and any opaque identifier where sequential order must not leak. The downside: random insertion order destroys B-tree locality in databases, causing page splits and slower index scans on write-heavy tables.

v7 (RFC 9562, ratified 2024) embeds a 48-bit Unix millisecond timestamp in the first 48 bits, followed by random bits. Lexicographic sort equals time sort. Use v7 for database primary keys in PostgreSQL, MySQL, MongoDB, and any write-heavy table where chronological sort order matters. Index performance is dramatically better than v4 because rows insert in roughly sequential order. Most new schemas in 2026 default to v7. See the deep-dive: UUID v4 vs v7 for databases.

v1 encodes your MAC address and a timestamp — a privacy risk; avoid it in public-facing systems.

v8 is reserved for custom/experimental formats and is not intended for general use.

UUID format

A UUID is always 32 hexadecimal digits arranged in five groups separated by hyphens, totalling 36 characters:

xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx

Example (v4):

550e8400-e29b-41d4-a716-446655440000

The format is identical whether you call them UUIDs (IETF) or GUIDs (Microsoft) — the 36-character string is the same. Some systems strip hyphens for a compact 32-char hex form; others wrap in braces ({550e8400-...}) for .NET Guid compatibility. This tool supports all three output styles.

UUID collision probability

UUID v4 has 122 random bits, giving 2122 possible values — approximately 5.3 × 1036 unique UUIDs. To put that in perspective:

For practical purposes: you will never see a UUID collision in production. The birthday-paradox math only becomes relevant at astronomical scale. Read the full analysis: UUID collision probability explained.

UUID in different languages

Every major runtime ships native UUID generation. No third-party library needed in most cases:

JavaScript / TypeScript (Node.js 19+ and all modern browsers)

// Native — no library needed
crypto.randomUUID() // returns a v4 UUID string

Python

import uuid

str(uuid.uuid4())   # v4 random UUID
str(uuid.uuid7())   # v7 time-sorted UUID (Python 3.14+)

Go

import "github.com/google/uuid"

uuid.New().String()        // v4
uuid.Must(uuid.NewV7()).String() // v7

PHP

// PHP 8.3+
$uuid = \Symfony\Component\Uid\Uuid::v4()->toRfc4122();
// or composer require ramsey/uuid
\Ramsey\Uuid\Uuid::uuid4()->toString();

SQL (PostgreSQL 13+)

SELECT gen_random_uuid(); -- v4, built-in, no extension needed

When to use a UUID (and when not to)

FAQ

Is UUID the same as GUID?

Yes. GUID (Globally Unique Identifier) is Microsoft's terminology; UUID (Universally Unique Identifier) is the IETF/RFC term. Both describe the same 128-bit, 36-character format defined in RFC 9562 (formerly RFC 4122). You will see "GUID" in .NET, SQL Server, and COM; "UUID" everywhere else — the underlying bytes are identical.

Can I use UUID as a database primary key?

Yes, and the version matters. Use v7 for primary keys — the embedded timestamp keeps rows inserting in roughly sequential order, which preserves B-tree locality and gives you far better index performance on write-heavy tables (PostgreSQL, MySQL InnoDB, MongoDB). Use BINARY(16) or the native UUID type rather than VARCHAR(36) to halve storage and index size. v4 works but causes random page splits at scale.

What's the difference between UUID and ULID?

Both are time-sortable 128-bit identifiers, but they differ in encoding and ecosystem. ULIDs encode as 26 base32 characters (URL-safe, no hyphens, case-insensitive), while UUIDs encode as 36 hex characters with hyphens. UUIDs have native support in virtually every database, language runtime, and framework. ULIDs are more compact and prettier in URLs. If you're starting from scratch and don't need UUID compatibility, either works — pick UUID for maximum portability.

Why not v1 or v5?

v1 encodes your MAC address and a high-resolution timestamp — a privacy leak in public-facing identifiers. v5 generates deterministic UUIDs from a namespace + name hash (SHA-1), useful for reproducible IDs but not for unique random ones. v4 and v7 cover ~99% of real-world use cases.

Is this tool offline?

Yes. All generation uses crypto.randomUUID() (v4) and crypto.getRandomValues() (v7 entropy) — both backed by your operating system's CSPRNG. No data is sent to any server.

Related tools

Related articles

Pillar

Part of Encoding & Crypto — Base64, URL, JWT, hashes, UUID, QR, password.


Written by Mian Ali Khalid. Last updated 2026-05-12.