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 recipeGenerate 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.
Choose a version, quantity, and output format.
Generate UUIDs to see them here.
Paste a UUID, GUID, hyphenless value, or URN to inspect it.
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.
console.log(crypto.randomUUID()) Built into modern browsers and Node.js 19+; Node 14.17+ can use require('crypto').randomUUID().
Read the UUID generation recipeimport uuid; print(uuid.uuid4()) Standard library, no package required.
Read the UUID generation recipejava.util.UUID.randomUUID().toString() Fully qualified so it works without an import line.
Read the UUID generation recipeuuid.NewString() With the github.com/google/uuid package.
Read the UUID generation recipeGuid.NewGuid().ToString() GUID is the .NET name for the same format.
Read the UUID generation recipeSELECT gen_random_uuid(); Built in on PostgreSQL 13+; older versions need pgcrypto.
Read the UUID generation recipeBoth versions are 128-bit UUIDs with the same wire format. The important difference is where the bits come from.
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.
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.
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.
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.
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.
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.
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.
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.
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.