UUID v7 Generator
Generate time-ordered UUID v7 identifiers for database primary keys that sort by creation time.
01a1f827-1e8d-71c2-8b5a-b39cbb5ebdf213UUID v7 is a time-ordered UUID suitable for database primary keys.
UUID v7 is a time-ordered UUID format. The first 48 bits hold a Unix timestamp in milliseconds and the rest are random, so the UUIDs sort by creation time and stay unique.
UUID v4 values can't be sorted by time. UUID v1 values can, but they include the generating machine's MAC address. UUID v7 sorts by time without exposing a MAC address.
Database keys
Primary keys that sort by insertion time
Logging
IDs for log entries that sort by time
Distributed systems
Sortable IDs generated on many servers without coordination
Event streams
Ordered event IDs for streaming systems
What is UUID v7?
UUID v7 is a time-ordered UUID format defined in RFC 9562. It stores a Unix timestamp in milliseconds in the first 48 bits, followed by random data. UUID v4 is fully random, but UUID v7 values sort in the order they were created.
Why use time-ordered UUIDs?
Like auto-increment IDs, they sort in insertion order, which keeps B-tree indexes compact. Like other UUIDs, any machine can generate them without coordination, and they don't reveal how many rows you have. That makes them a good fit for distributed systems.
How is UUID v7 different from UUID v4?
UUID v4 is fully random, so it can't be sorted by time. UUID v7 starts with a timestamp, so it sorts by creation time and suits primary keys where insertion order matters.
Can I use UUID v7 as database primary keys?
Yes. This is the main use case for UUID v7. Because each new value is larger than the last, new rows go at the end of the index instead of at random positions as with UUID v4, which keeps B-tree inserts cheap.
What about UUID v1?
UUID v1 also contains a timestamp, but it includes the MAC address of the machine that generated it, which can identify that machine. UUID v7 uses random bits instead of a MAC address and still sorts by time.
Private by default
The tool generates UUIDs in your browser and sends nothing to a server.
Related tools
JSON Formatter
Format JSON online in your browser. Paste or upload JSON to tidy it with 2 or 4 space indents, find syntax errors, minify it or browse it as a collapsible tree.
JavaScript to JSON
Convert JavaScript object literals to valid JSON
JSON Merge
Merge two JSON objects online with a deep or shallow strategy and choose how arrays combine. Useful for config files and API responses. Free, no signup.