Skip to main content
CalcChef

UUID v7 Generator

Generate 1 to 1,000 UUID v7 values that stay in creation order on one page, and decode a UUID to its version, variant and timestamp. How it works

Use the UUID v7 Generator

UUID v7: time-ordered identifiers (RFC 9562)

    Decode an existing UUID

    About the UUID v7 Generator

    A UUID v7 starts with a 48-bit Unix timestamp in milliseconds, so its text form sorts in time order. This generator makes 1 to 1,000 and keeps them strictly increasing within one page, even inside one millisecond; across tabs or machines the order is only right to the millisecond. The decoder reads the version, variant and, for v1, v6 and v7, the timestamp.

    UUIDs the decoder reads

    UUIDVersionTimestamp (ms)ISO 8601
    017f22e2-79b0-7cc3-98c4-dc0c0c07398f716455577420002022-02-22T19:22:22.000Z
    c232ab00-9414-11ec-b3c8-9e6bdeced846116455577420002022-02-22T19:22:22.000Z
    ffffffff-ffff-7fff-bfff-ffffffffffff7281474976710655+010889-08-02T05:31:50.655Z
    550e8400-e29b-41d4-a716-4466554400004nonenone

    What the Decode button shows. A v4 UUID carries no timestamp. The third row is the largest 48-bit value, the last millisecond a v7 UUID can hold.

    How to use this tool

    1. Type a quantity from 1 to 1,000 and press Generate.
    2. Tick Uppercase or untick Hyphens if your system wants that form; the list and the copy follow.
    3. Press Copy All for the list, or the copy button on a row for one UUID.
    4. To read a UUID, paste it into the decode box and press Decode.

    Frequently asked questions

    Is UUID v7 sortable?
    Yes, by time. The 48-bit millisecond timestamp comes first, so the text form sorts in creation order (RFC 9562 section 6.11). Two UUIDs from the same millisecond sort by the counter that follows.
    Are UUIDs made in the same millisecond in order?
    On one page, yes. The 12-bit field after the version is a counter that starts at a random value below 2,048 in each new millisecond and goes up by 1 for each UUID, so 1,000 UUIDs made in one millisecond stay in creation order. If the counter would pass 4095 the timestamp moves one millisecond ahead. The guarantee covers a single generator: two tabs order their UUIDs only to the accuracy of the clock, and two machines can disagree by far more, since their clocks can differ by much more than a millisecond.
    How do I read the timestamp in a UUID v7?
    The first 12 hex digits are the Unix time in milliseconds. In 017f22e2-79b0-7cc3-98c4-dc0c0c07398f, 017f22e279b0 is 1645557742000, which is 2022-02-22T19:22:22.000Z.
    Which UUID formats can the decoder read?
    The 8-4-4-4-12 form, the same 32 hex digits without hyphens, with braces around it, or with a urn:uuid: prefix, in upper or lower case. Anything else gets the message Not a UUID, with the format it expects.
    Should I use UUID v7 or v4 for database keys?
    RFC 9562 says time-ordered values keep new rows close together in an index, while v4 values land at random positions, which it says can hurt performance. A v7 UUID also shows its creation time to anyone who has it, which a v4 UUID does not.
    Can two UUID v7 values collide?
    Not on one page: each value is above the one before. Values from different pages or machines can repeat only if they share the millisecond, the 12-bit counter and all 62 random bits, which are drawn fresh for every UUID; two values with the same timestamp and counter match by chance 1 time in 2^62, about 4.6 × 10^18. RFC 9562 section 6.8 says true global uniqueness cannot be guaranteed without a shared scheme, so keep a unique constraint on a key column.

    Related Tools

    View all tools