UUID v7 & UUID v4 Generator & Inspector (RFC 9562)

Web Crypto CSPRNG · Time-ordered UUID v7 · Extracts UTC timestamp · Bulk export

Generated Identifiers

        
Live Timestamp & Metadata Decoder
Ready
CSPRNG crypto.getRandomValues · 100% Local
Advertisement
Reserved fixed-height slot (CLS = 0.00) 728×90 320×100 300×50

Why Modern Postgres and MySQL Primary Keys Prefer UUID v7 Over UUID v4

Standardized in RFC 9562 (May 2024), UUID v7 embeds a 48-bit Unix epoch millisecond timestamp in its leading 12 hex characters followed by 74 bits of cryptographic randomness. Because consecutive UUID v7 values sort chronologically as raw bytes or lowercase strings, PostgreSQL and InnoDB B-Tree indexes append sequentially instead of causing cache-thrashing random page splits across memory.

UUID v4 remains the right choice when you must hide creation timestamps (for example, public password-reset tokens, share links, or order confirmation tokens where leaking creation time or volume is undesirable). All generation here uses the browser's hardware-backed crypto.getRandomValues() CSPRNG—never Math.random().

  • RFC 9562 UUID v7 Layout48-bit big-endian Unix epoch ms · 4-bit version (7) · 12-bit rand_a · 2-bit variant (10) · 62-bit rand_b.
  • RFC 9562 UUID v4 Layout122 bits of Web Crypto CSPRNG entropy (crypto.getRandomValues) with version 4 and variant 10xx bits.
  • Database Index ImpactUUID v7 inserts monotonically at the B-Tree right edge, eliminating random page splits caused by UUID v4.
How do I extract the creation timestamp from a UUID v7?

Strip hyphens and take the first 12 hexadecimal characters (48 bits). Converting that 48-bit big-endian hex integer to decimal gives the exact Unix epoch millisecond timestamp.

Is UUID v7 safe to use as an unguessable security token?

UUID v7 exposes its millisecond creation time and has 74 random bits (still strong against collisions, though less opaque than v4's 122 random bits). For bearer tokens or password resets, prefer 256-bit random tokens or UUID v4.

Are UUID v7 strings compatible with existing PostgreSQL uuid columns?

Yes. UUID v7 uses the exact same 128-bit 8-4-4-4-12 canonical format as UUID v4 and works natively in PostgreSQL, MySQL UUID_TO_BIN, SQL Server, and JSON APIs.