UUIDs (Universally Unique Identifiers) are a fundamental building block in modern software. Whether you're designing database schemas, building REST APIs, or working in distributed systems, choosing the right UUID version can significantly impact your application's performance and maintainability.

This guide focuses on the two most relevant UUID versions for today's developers — v4 (random) and v7 (time-ordered) — along with practical tips on UUID format options, bulk generation, and when to reach for each variant.

UUID v4 — The Random Standard

UUID v4 has been the go-to choice for over a decade. Defined in RFC 4122, v4 UUIDs generate 122 random bits (6 bits are reserved for version and variant markers). A typical v4 UUID looks like:

550e8400-e29b-41d4-a716-446655440000

The version digit (4) appears at position 13. The variant digit (a or b) appears at position 17.

Advantages of v4:

Disadvantages: v4 UUIDs are fully random, which causes poor B-tree index performance in databases. Each insertion lands at a random page, leading to index fragmentation and cache misses. This is the primary reason v7 was created.

UUID v7 — Time-Ordered for Databases

UUID v7 is the modern alternative, standardized in RFC 9562 (published May 2024). It combines a Unix timestamp (millisecond precision) with random data, producing time-ordered UUIDs that play nicely with database indexes.

018f3a6e-7b1c-7b00-a123-2c9b9c8a4f3d

Notice the version digit 7 at position 13. The first 48 bits encode a Unix timestamp in milliseconds, giving roughly 48 bits of time-based ordering before the random portion kicks in.

Advantages of v7:

Disadvantages: v7 is still being adopted. Some older databases and programming environments don't support it natively yet. Databases like MySQL 9.0+ and PostgreSQL (via extensions) now support v7, and it's gaining momentum fast.

UUID v4 vs v7: When to Use Each

The choice between v4 and v7 depends on your use case:

Use Case Recommended
Database primary keys (new projects) UUID v7 — better index performance
API resource identifiers Either — both work equally well
Session tokens UUID v4 — fully random, no timing leakage
Legacy system compatibility UUID v4 — universally supported
Distributed/offline systems Either — both work without coordination
Sortable identifiers UUID v7 — inherently time-ordered

For new projects using modern databases (MySQL 9+, SQL Server 2022+, or PostgreSQL with pg_uuidv7), v7 is increasingly the default recommendation. For maximum compatibility or security-sensitive contexts (session tokens, CSRF tokens), stick with v4.

UUID Format Options: Dashes, Uppercase, and Bulk Generation

When generating UUIDs, you'll encounter several formatting choices. A good UUID generator gives you full control over the output:

With Dashes vs Without Dashes

The standard UUID format includes four hyphens: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. This 36-character form is the canonical representation per RFC 4122. However, many systems use the 32-character hex-only form (no dashes) for storage efficiency. Both represent the same 128-bit value — the dashes are purely cosmetic.

Uppercase vs Lowercase

UUIDs are case-insensitive by specification, but lowercase is the convention. Most generators default to lowercase (550e8400-e29b-41d4-a716-446655440000). Uppercase is occasionally preferred for printed materials or systems that use uppercase hex conventionally. Our UUID generator lets you toggle between both formats with one click.

Bulk UUID Generation

Need 50 UUIDs for a migration or seed file? Bulk generation saves enormous time. Look for a generator that supports generating 10, 50, 100, or more UUIDs at once, with one-click copy support. This is especially useful when populating test data or generating identifiers for a batch import.

How to Generate UUIDs Online

Using our free online UUID generator, you can:

All processing happens in your browser using the Web Crypto API. Your data never reaches our servers — privacy by design.

Related Tools for Developers

Beyond UUID generation, here are other developer tools you might find useful:

Whether you're building a distributed system, migrating a legacy database, or just need a unique identifier for your next project, understanding the differences between UUID v4 and v7 will help you make the right choice. Use our UUID generator to experiment with both versions and their format options — it's free, fast, and fully private.

Related Tools

UUID Generator Random Number Generator Hash Generator Base64 Encode/Decode Password Generator