StackPractices
100% client-side UUID v7 ready

UUID Generator

Generate random UUID v4 or time-ordered UUID v7, copy up to 100 at once, and inspect the version, variant, and timestamp hidden inside any UUID. Everything runs locally in your browser.

Generate UUIDs

Choose a version, quantity, and output format.

Generated values

Generate UUIDs to see them here.

    Decode a UUID

    Paste a UUID, GUID, hyphenless value, or URN to inspect it.

    Generate UUIDs in your language

    Prefer generating identifiers inside your application or database? Start with one of these one-liners, then use the full recipe for v7 examples, database schema notes, and migration trade-offs.

    JavaScript / Node.js

    console.log(crypto.randomUUID())

    Built into modern browsers and Node.js 19+; Node 14.17+ can use require('crypto').randomUUID().

    Read the UUID generation recipe

    v4 vs v7 in practice

    Both versions are 128-bit UUIDs with the same wire format. The important difference is where the bits come from.

    UUID v4: random and portable

    A v4 UUID has 122 random bits. It is supported almost everywhere and avoids leaking creation time, ordering, host details, or sequence information. Use it for public IDs, compatibility with older systems, and cases where randomness is more useful than ordering.

    UUID v7: ordered by time

    RFC 9562 defines v7 with a 48-bit Unix timestamp in the leading bits. New IDs mostly increase lexicographically, which improves locality in B-tree indexes and makes v7 attractive for database primary keys and event-like records.

    How random is random enough?

    UUID v4 fixes six bits for the version and variant, leaving 122 random bits — about 5.3 × 10³⁶ possible values. The birthday bound means collisions become easier as volume grows, but even billions of generated IDs leave an accidental collision probability far below practical concern. Enforce database uniqueness anyway when a duplicate would be harmful.

    Why not Math.random()?

    Math.random() is not a cryptographic random source. It is fine for games and visual effects, but identifiers should come from crypto.getRandomValues() or a platform CSPRNG. This generator uses the browser crypto API, and the values never leave the page.

    Related resources

    UUID generator FAQ

    What is the difference between UUID v4 and UUID v7?

    UUID v4 is almost entirely random, while UUID v7 starts with a Unix timestamp in milliseconds. That makes v7 values sortable by creation time and usually friendlier to database indexes. v4 remains the safest default when broad compatibility matters more than ordering.

    Should I use UUID v7 as a database primary key?

    Usually yes when your database and libraries support it. Because new v7 IDs are larger than recent ones, inserts tend to append near the right side of a B-tree index instead of scattering pages throughout it. Check driver and database support before migrating an existing schema.

    Can two random UUIDs collide?

    A UUID v4 has 122 random bits after the fixed version and variant bits. Accidental collisions are astronomically unlikely at practical volumes. They are not mathematically impossible, so uniqueness constraints still matter when a duplicate would corrupt data.

    What is the difference between a UUID and a GUID?

    In practice they are the same 128-bit identifier format. GUID is the name commonly used in Microsoft ecosystems; UUID is the cross-platform and standards-oriented name. This tool can output braces for tools that expect Windows-style GUIDs.

    Does this UUID generator send my IDs anywhere?

    No. Generation and decoding run entirely in your browser with crypto.getRandomValues. There are no network calls, analytics tied to generated values, server logs, or stored identifiers.