Guide

UUID v4 vs UUID v7

Use this guide when you need stable-looking IDs for examples, fixtures, or database rows and want to understand which UUID version fits the job.

Short answer

  • UUID v4 is random and is the common default for test data, examples, and general unique identifiers.
  • UUID v7 includes timestamp ordering, which can make database indexes and event streams easier to work with.
  • Tidy Utils currently generates UUID v4 values locally in your browser, plus nil and max reference UUIDs.

UUID v4 and UUID v7 comparison

VersionHow it is builtGood forWatch out for
UUID v4Mostly random bitsMock data, fixtures, examples, client-side IDsNot naturally sortable by creation time
UUID v7Timestamp plus random bitsOrdered records, logs, event data, database insertsRequires library support and careful implementation
Nil UUIDAll zeroesPlaceholder documentation and sentinel examplesShould not be treated as a generated unique ID

When UUID v4 is enough

Use UUID v4 when you need realistic identifiers for test payloads, screenshots, fixtures, documentation, or temporary records.

For most browser-side examples and mock API data, UUID v4 is simpler than carrying timestamp-ordering assumptions into the sample.

When UUID v7 matters

UUID v7 can be useful when records need IDs that roughly sort by creation time. That can matter for database indexes, append-heavy tables, event streams, and log-like data.

If ordering is the real requirement, confirm your database, backend library, and downstream systems all support the UUID version you choose.

Documenting UUID fields

When a JSON payload includes UUID fields, use a schema description or field notes to explain whether the value is a random ID, an ordered ID, a placeholder, or a foreign key.

A generated schema can infer that an ID field is a string, but it cannot prove the UUID version or business meaning from one example.

FAQ

Does Tidy Utils generate UUID v7 values?

No. The current UUID tool generates UUID v4 batches and reference UUIDs locally in the browser.

Should I use UUID v4 for security tokens?

No. UUIDs are identifiers, not secrets. Do not use generated UUIDs as passwords, API keys, session tokens, or reset links.

Can UUID v4 values collide?

A collision is extremely unlikely for normal use, but UUID v4 uniqueness is still probabilistic rather than mathematically guaranteed.