How to Generate UUID v7 Values Step by Step
Reviewed by the OnlineFree.app team · Updated
Key points
- A UUID v7 starts with a 48-bit Unix millisecond timestamp, so values sort roughly by creation time.
- The UUID v7 Generator produces up to 1000 RFC 9562 values per batch entirely inside your browser.
- UUID v7 ordering is millisecond-accurate only; same-millisecond values are not guaranteed to sort in generation order.
- Turning hyphens off returns the 32-character compact form, which some validators will reject.
- A UUID v7 exposes its creation timestamp, so it should never be treated as a secret token.
What is a UUID v7 and how is it structured?
A UUID v7 is a 128-bit identifier defined in RFC 9562 whose first 48 bits hold a Unix timestamp in milliseconds, which makes values sort in roughly the order they were created. The remaining 74 bits are random, so a v7 is both time-ordered and practically impossible to guess.
Take the example 018f2c9e-4f1a-7c3b-9d20-8a5f1c7e0b42. The first 12 hex characters (018f2c9e4f1a) encode the timestamp; the 7 at the start of the third group is the version nibble; the leading 9 of the fourth group is the variant. Any character from 8 to b in that position is valid.
That is the main difference from UUID v4, which is 122 random bits with no ordering at all. A v7 is not "more unique" in any practical sense, but it is sequential: 74 random bits still leave roughly 1.89 × 10^22 possible values inside a single millisecond. The full layout is specified in the RFC 9562 standard.
How to generate UUID v7 values step by step
Open the UUID v7 Generator and it is already working: the page renders 10 lowercase hyphenated values on load, so you never hit an empty screen. No signup, no install, no API key — the values are produced client-side in your browser.
Set how many UUIDs you need in the count field, leave the two toggles alone unless you have a reason, then press Generate. The results appear in a scrollable monospace list directly below the controls, one UUID per line, in generation order from oldest to newest. A small counter above the list confirms how many were returned and which format was actually used.
Copy one line at a time, hit Copy all for the whole batch, or use Download .txt to save the same text as a plain file written through a Blob URL in the browser. Regenerate replaces the batch with fresh values. If you are building a seed file, generate 500 or 1000 rows and export once rather than pressing Generate repeatedly.
Batch size, case, and hyphen settings explained
The count field takes an integer between 1 and 1000. Values above 1000 are silently clamped to 1000, and anything non-numeric falls back to the default of 10 — so typing "5000" gives you 1000 UUIDs, and typing "abc" gives you 10. Nothing errors out, which is convenient but means you should glance at the counter to confirm what you actually got.
Uppercase is off by default, and that is the right choice for most systems: lowercase hyphenated is the canonical RFC 9562 string form. Turn it on only when the receiving system stores or compares uppercase GUIDs, which happens in some SQL Server and .NET pipelines.
Include hyphens is on by default. Switching it off returns the 32-character compact form such as 018f2c9e4f1a7c3b9d208a5f1c7e0b42, which is handy for URLs, object-storage keys and fixed-width binary imports. Bear in mind that strict validators reject the compact form, so keep hyphens on unless the destination explicitly accepts the short version. The same browser-only approach powers the other free online tools on OnlineFree.app.
Where time-ordered UUIDs help — and where they don't
Because the leading 48 bits are a timestamp, new v7 rows land near the right edge of a B-tree index instead of scattering across it the way random v4 keys do. On write-heavy tables that generally means less page splitting and better index locality, which is the main reason teams have moved to v7. Fixtures and seed data also benefit: 1000 generated rows are already in chronological order, so you can eyeball a dataset without extra sorting.
The honest limitation is that v7 ordering is only millisecond-accurate. The UUID v7 Generator fills the random bits independently for every value, so two UUIDs created in the same millisecond are not guaranteed to sort in the order they were displayed. If you need strict monotonicity within a millisecond, you need a database sequence or a library that implements one of the counter-based methods described in RFC 9562 — not a plain generator.
Two more things worth knowing. A v7 leaks its creation time to anyone who reads it, so do not treat one as a secret token; 74 random bits still make guessing impractical, but the timestamp is public. And a v7 is still 16 bytes, exactly like v4, so switching does not change your column size. Background on the identifier family is on Wikipedia's UUID page.
Common mistakes when pasting UUIDs into a database
The most frequent problem is a format mismatch rather than a data problem. A column defined as CHAR(36) will silently accept a 32-character compact UUID on some databases and reject it on others, and regex validators that expect hyphens will flag it as malformed. Match the toggle to the destination column before you copy, not after.
Case inconsistency causes a subtler bug: 018f2c9e-4f1a-7c3b-9d20-8a5f1c7e0b42 and 018F2C9E-4F1A-7C3B-9D20-8A5F1C7E0B42 are the same UUID, but they are different strings. If one code path compares text case-sensitively and another stores uppercase, you get "duplicates" that are not duplicates. Pick one case, store it consistently — PostgreSQL's native uuid type normalizes this for you, plain text columns do not.
Finally, remember that the generator is a value producer, not a collision checker. It has no knowledge of the rows already in your table, and no generator can guarantee a value that has never been used before. Add a primary key or unique constraint on the column, and verify anything that matters before you commit it to production data.
Frequently asked questions
Is the UUID v7 Generator free, and do I need an account?
Yes, it is completely free and requires no signup, email or API key. The generator runs entirely in your browser with JavaScript, so no UUID is sent to a server and there is no per-request quota. Open the page, set your count, and copy or download the results immediately.
How many UUID v7 values can I generate at once?
Up to 1000 per batch, with 10 as the default. Numbers above 1000 are clamped to 1000, and non-numeric input falls back to 10 without showing an error. For seed data, generate the full 1000 and use Download .txt rather than pressing Generate several times.
Are the UUIDs from this tool real RFC 9562 UUIDs?
Yes. Each value uses a 48-bit Unix millisecond timestamp, sets the version nibble to 7 and the variant bits to 10, and is presented in the canonical lowercase hyphenated form. The uppercase and compact options are display formats only — the underlying 128 bits are unchanged and remain RFC 9562 compliant.
Can two UUIDs from the same batch be identical?
In practice no. Each value carries 74 random bits, giving roughly 1.89 × 10^22 combinations per millisecond, so accidental duplication inside a 1000-value batch is vanishingly unlikely. That is a probability argument, not a guarantee, so still enforce a primary key or unique constraint on the database column.
Should I use UUID v7 or UUID v4 as a primary key?
Use v7 when write performance and index locality matter, since its timestamp prefix makes inserts append rather than scatter. Use v4 when you want maximum randomness or you do not want the creation time embedded in the ID. Both occupy 16 bytes, and neither changes your schema or ORM setup.