jarvisbox

UUID v7 vs v4 Structure Comparison

UUID v4 is the most widely used version — 122 bits of randomness with the version nibble set to 4 and the variant bits set to 0b10. It is simple, collision-resistant, and requires no clock. The downside: v4 UUIDs do not sort in insertion order, causing page splits and index fragmentation in B-tree databases.

UUID v7 solves the ordering problem by embedding a 48-bit millisecond Unix timestamp in the most-significant bits. The remaining 74 bits (rand_a and rand_b) provide collision resistance within the same millisecond. Because the timestamp prefix is the same for IDs generated at the same time, v7 UUIDs cluster together in sorted indexes.

The key structural difference: in v7 bits 0–47 are the timestamp, whereas in v4 those same 48 bits are random. Both versions use the same bit positions for the version nibble (48–51) and variant bits (64–65). This tool lets you paste any UUID and see its exact bit assignment — version detected automatically.

Open UUID v7 Decode Bit Inspector →

How to use

  1. Paste one or more UUID strings into the main tool — version is auto-detected.
  2. Hover any cell in the 128-bit bitfield diagram to see the field name, bit index, and full field value.
  3. For batch UUIDs, check the monotonic-order badge and timestamp timeline to verify generation order.

Related tools

反馈这个工具的问题