Free Developer Tool — 100% Client-Side

UUID v7 Generator

Generate time-ordered UUID v7 identifiers. UUID v7 combines a Unix timestamp with random bits for sortable, database-friendly unique IDs.

Click Generate to create UUID v7 identifiers.
Sponsored
Advertisement

What Is UUID v7?

UUID v7 is a time-ordered UUID format defined in RFC 9562. Unlike UUID v4 (which is fully random), UUID v7 embeds a Unix timestamp (milliseconds) in the first 48 bits, followed by version and variant bits and random data. This makes UUID v7 values monotonically increasing over time — ideal for database primary keys where index performance matters. Our UUID v7 generator online creates these sortable identifiers instantly in your browser.

UUID v4 vs UUID v7

UUID v4

  • 122 random bits + 6 version/variant bits
  • Fully random, no temporal ordering
  • Poor database index performance (B-tree fragmentation)
  • Cannot be sorted by creation time
  • Widely supported in all languages

UUID v7

  • 48-bit timestamp + 74 random bits + 6 version/variant bits
  • Time-ordered, monotonically increasing
  • Excellent database index performance
  • Sortable by creation time
  • Newer standard (RFC 9562), growing adoption

Why Use UUID v7 for Database Keys?

Traditional auto-increment integer keys cause issues in distributed systems — they require coordination to generate unique values. UUID v4 solves uniqueness but creates index fragmentation in B-tree databases like PostgreSQL, MySQL, and SQLite because random inserts split pages frequently. UUID v7 solves both problems: values are globally unique without coordination and they sort chronologically, keeping database indexes compact and efficient. This makes UUID v7 the recommended choice for modern applications using CUID2-style identifiers or ULIDs — but with a standardized format.

How to Generate UUID v7

Set the quantity (1–100) and click Generate. Each UUID v7 is displayed as a single line in the output area. Use Copy All to copy every UUID to your clipboard at once — one per line. UUID v7 values embed the current timestamp, so generating them at different times produces naturally ordered results. This is perfect for database seed scripts, API payloads, and event sourcing systems.

UUID v7 Format

UUID v7 follows the standard 8-4-4-4-12 hex representation: tttttttt-tttt-7xxx-yxxx-xxxxxxxxxxxx Where t is the timestamp (Unix epoch milliseconds), 7 is the version number, x is random, and y encodes the variant (10xx). This structure ensures chronological ordering when sorted lexicographically.

Sponsored
Advertisement
Technical Documentation & Standards

Technical Specifications & Standards UUID Version 7 (UUIDv7) is a modern, time-ordered universally unique identifier standardized by the IETF in RFC 9562 ('New UUID Formats', superseding RFC 4122). While legacy UUIDv4 generates 122 bits of completely random data, UUIDv7 combines a 48-bit Unix epoch millisecond timestamp with 74 bits of sub-millisecond precision, sequence counters, and cryptographically secure random entropy. The 128-bit layout is organized as follows: - Bits 0–47 (48 bits): Unix timestamp in milliseconds (providing ~8,900 years of timestamp coverage). - Bits 48–51 (4 bits): Version identifier ('0111' for version 7). - Bits 52–63 (12 bits): Sub-millisecond precision fraction or monotonic sequence counter. - Bits 64–65 (2 bits): Variant identifier ('10' for RFC 9562). - Bits 66–127 (62 bits): Cryptographically secure random entropy.

How It Works in Your Browser WebUtil's UUIDv7 Generator creates RFC 9562-compliant identifiers client-side using the browser's Date.now() timestamp and window.crypto.getRandomValues(). The 48-bit timestamp is bit-shifted into the most significant bytes, ensuring natural chronological sortability. The version and variant bits are injected using bitwise masks, and remaining bytes are populated with cryptographic randomness. The resulting 128-bit integer is formatted into the canonical 8-4-4-4-12 hyphenated hexadecimal string.

Developer Guide & Common Pitfalls UUIDv7 solves the single greatest problem associated with database primary keys: - Eliminating B-Tree Index Fragmentation: In relational databases (PostgreSQL, MySQL InnoDB, SQLite), random UUIDv4 keys cause page splits and severe B-Tree index fragmentation, slowing write performance by orders of magnitude on large tables. Because UUIDv7 values are naturally monotonic (increasing over time), inserts append sequentially to index leaf pages, matching the high insertion speed of auto-incrementing integers while preserving global uniqueness. - UUIDv1 vs UUIDv7 Privacy: Version 1 UUIDs encoded the physical MAC address of the host computer, exposing hardware identity and user location. UUIDv7 uses pure cryptographic randomness after the timestamp, leaking zero hardware information. - Monotonicity Within the Same Millisecond: When generating multiple UUIDv7 values within the exact same millisecond, WebUtil increments the sub-millisecond sequence counter to preserve strict ascending order.

Zero-Knowledge Privacy & Security Assurance Every UUIDv7 generated on WebUtil is created in your browser's local memory. Zero identifiers are sent to any remote server or database.

High-Performance Database Primary Keys Adopting UUIDv7 as the universal primary key format across distributed microservices provides the ideal combination of decentralized generation and optimal database index performance. Unlike auto-incrementing integers that expose business metrics (such as total order counts) and require database coordination, UUIDv7 provides global uniqueness, high security, and sequential B-Tree index insertion performance on modern PostgreSQL and MySQL databases.

Monotonic Sorting & Sharding Efficiency In horizontally partitioned distributed databases (such as CockroachDB, YugabyteDB, or Vitess), UUIDv7 timestamps facilitate time-range data pruning and balanced shard distribution, combining the scaling benefits of distributed keys with the locality benefits of ordered sequences.

How to Do This in Code

Deploy Your Next Project Fast

Get $200 free credit on DigitalOcean to deploy your apps with blazing-fast infrastructure.

UUID v7 Generator FAQ

What is UUID v7 and how is it standardized by RFC 9562?

UUID v7 is a time-ordered, 128-bit universally unique identifier standardized by RFC 9562. It combines a 48-bit Unix timestamp with 74 random bits, making it sortable by generation time.

Why is UUID v7 vastly superior to UUID v4 for database primary keys?

UUID v4 is completely random, causing B-Tree index fragmentation, page splits, and slow database writes. UUID v7 is sequential, enabling sequential disk writes and fast index lookups like auto-incrementing IDs.

Can someone deduce the creation time from a UUID v7 identifier?

Yes. The first 48 bits encode the Unix epoch timestamp in milliseconds, allowing anyone to extract the exact creation date and time from the UUID string.

Are UUID v7 values compatible with existing UUID column types in Postgres and MySQL?

Yes. UUID v7 uses the identical 128-bit (36-character hyphenated) binary structure as UUID v4 and stores seamlessly in native UUID columns in PostgreSQL, MySQL, and SQLite.

Can I generate batches of UUID v7 identifiers at once?

Yes. WebUtil allows you to generate single or bulk batches of UUID v7 IDs with one-click copying to your clipboard.