UUIDv7 Generator
Generate RFC 9562 compliant UUIDv7 values, decode the timestamp encoded inside any UUIDv7, and generate batches to compare the sortability of v7 against v4 side by side.
FreeOnline Tool
Loading…
How to Use
- In the "Generate a single UUIDv7" section, click "Generate" to produce an RFC 9562 compliant UUIDv7. Copy it with one click, or click "Send to parser below" to inspect the timestamp it encodes
- In the "Parse UUIDv7" section, paste any UUIDv7 string and click "Parse" to extract the encoded millisecond timestamp, the readable date and time, the version number and the variant bits. If the input is not a valid UUIDv7 (for example the version nibble is not 7), the tool states exactly what is wrong
- In the "Batch generate and compare sortability" section, enter a count N and click the button. The tool generates N UUIDv7 values and N UUIDv4 values, listing each set both in generation order and in string-sorted order so you can compare row by row — the v7 set reports "sorted order equals generation order" while the v4 set normally does not, demonstrating that UUIDv7 is inherently sortable and UUIDv4 is not
Features
- Generated strictly to the RFC 9562 bit layout (the new UUID specification published in May 2024): the first 48 bits are a millisecond Unix timestamp, the 13th character is fixed to 7 (version), the 17th character is one of 8/9/a/b (variant), and the rest is random
- Includes a UUIDv7 parser: paste a value and it extracts the encoded timestamp, converts it to a readable date and time, and verifies that the version and variant bits are valid
- Batch generation uses the fixed-length dedicated counter method recommended in RFC 9562 §6.2 for UUIDs created within the same millisecond, filling the rand_a field with a monotonic counter instead of pure randomness so batch results sort by string exactly in generation order, regardless of the system clock's typical 1 ms resolution
- Also generates UUIDv4 batches for comparison, with both sets reporting whether sorted order equals generation order so you can see the difference for yourself
- Complements the site's existing uuid-generator (standard v4 only, purely random and unsortable) rather than duplicating it: this tool covers the newer v7 version and its sortability
Use Cases
Database primary key design
Use UUIDv7 instead of an auto-increment ID or UUIDv4 as a primary key to get global uniqueness plus insertion locality, reducing random writes and page splits in B+ tree indexes.
ID generation in distributed systems
Multiple nodes can produce globally unique, roughly time-ordered IDs with no coordination, which suits distributed tracing, logging and message queues.
Understanding and verifying UUIDv7
Use the parser to see exactly which timestamp a UUIDv7 encodes and confirm that the values your own code produces follow the specification.
Comparing options for a technical decision
Show your team why a new project should consider UUIDv7 over UUIDv4 for keys, using the sortability comparison to make the difference obvious.
FAQ
Does this duplicate the existing uuid-generator on this site?
No, they complement each other. uuid-generator only produces standard UUIDv4, which is purely random and completely unordered. This tool generates UUIDv7 from RFC 9562, published in 2024, whose first 48 bits are a timestamp so the values are inherently sortable, and it adds v7-specific timestamp parsing and sortability comparison that v4 neither has nor needs.
Does UUIDv7 really guarantee time-ordered sorting?
Across milliseconds, string sorting of UUIDv7 values naturally matches the order they were created. Within the same millisecond the specification lets each implementation choose its own approach; this tool's batch generator uses the monotonic counter method recommended by RFC 9562, so its output is guaranteed strictly increasing. If you use another library, the within-millisecond guarantee depends on which approach that library adopted.
How precise is the parsed timestamp?
Millisecond precision. The first 48 bits of a UUIDv7 encode a Unix millisecond timestamp, and the parser shows both the raw millisecond value and the converted readable date and time in ISO 8601 format.
Should UUIDv7 replace UUIDv4 everywhere?
Not necessarily. Because a UUIDv7 begins with a timestamp and increases predictably, any sensitive context where an identifier must not leak roughly when it was created — certain security tokens, for example — should stick with a fully random scheme such as UUIDv4. For database primary keys, logging and tracing, the sortability of UUIDv7 is usually an advantage.