Rankato

Free UUID Generator (v4, v7, v1, v5)

Generate cryptographically secure UUIDs in bulk. Supports v4 random, v7 time-ordered, v1 timestamp, v5 SHA-1 deterministic, plus NIL and MAX sentinels. Multiple output formats.

Version
CountUp to 1,000 per batch
Generated0 UUIDs
UUIDs will appear here.

Generated in your browser · nothing is uploaded · uses crypto.getRandomValues

The UUID Generator produces universally unique identifiers in every version and format that matters. v4 is the universal default — 122 bits of cryptographic randomness from crypto.getRandomValues. v7 (RFC 9562 draft) prefixes a 48-bit Unix millisecond timestamp so IDs sort by generation time — a game-changer for database primary keys because inserts stay near the B-tree hot spot instead of scattering. v1 uses the classic Gregorian 100-ns timestamp with a random node identifier (multicast bit set per RFC 4122 §4.5, so we don't leak your MAC). v5 is deterministic — a SHA-1 hash of a namespace UUID plus a name, so the same input always yields the same UUID (useful for stable IDs from external keys). NIL (all zeros) and MAX (all ones) are RFC sentinels. Generate up to 1,000 at a time, in canonical, uppercase, hex-only, braces, or URN format.

Which UUID version should you use?

The short answer: v7 for database primary keys, v4 for everything else. UUID v4 is 122 bits of pure randomness — universally supported, collision-safe at astronomical scale, and easy to generate anywhere. It's the right default for public identifiers, session tokens, request IDs, and event IDs. The downside: because v4s are random, inserting them as a primary key scatters writes across your B-tree index, hurting insert throughput as the table grows. v7 fixes that by prefixing a 48-bit Unix millisecond timestamp — new UUIDs are lexicographically ordered by generation time, so inserts stay near the index hot spot. Postgres, MySQL, and SQLite all handle v7 as a drop-in replacement for v4 with better locality. v1 is the older timestamp variant; it's fine but harder to work with (Gregorian epoch, weird byte ordering) and largely superseded by v7. v5 is the odd one out — it's deterministic: the same namespace and name always produce the same UUID. Reach for it when you need a stable ID derived from external keys (email addresses, URLs, external IDs) without a lookup table.

v7 in depth — the time-ordered UUID

UUID v7 (RFC 9562, published 2024) has a simple layout: 48 bits of Unix milliseconds, 4 bits of version (0x7), 12 bits of random data (called rand_a), 2 bits of variant, then 62 bits of random data (rand_b). That's 74 bits of entropy per UUID — plenty of collision resistance. The timestamp prefix means every UUID generated after another one sorts after it, which unlocks two big wins: primary-key inserts stay clustered instead of scattering (huge for large tables), and range scans by ID approximate range scans by creation time (useful for pagination and log queries). Within the same millisecond, order is essentially random — this generator adds a small counter into rand_a to keep multiple UUIDs from the same tick monotonic, which matters when you generate a burst in a tight loop. If you're picking a primary-key strategy today with no legacy constraints, v7 is the right call.

v5 for deterministic IDs from external keys

UUID v5 hashes a namespace UUID and a name string with SHA-1 and formats the first 16 bytes as a UUID. The RFC defines four standard namespaces: DNS for hostnames, URL for URIs, OID for ISO OIDs, and X.500 for LDAP DNs. You can also use any custom UUID as a namespace — the effect is a fresh, non-colliding ID space you own. The killer property: given the same namespace and name, v5 always produces the same UUID. Use it to derive stable internal IDs from external identifiers (an email address, a Stripe customer ID, a Twitter handle) without a database lookup table. Two systems given the same inputs will independently compute the same UUID, which is useful for merging data or de-duplicating records. v5 uses SHA-1, which is broken for collision-resistance but fine here because we only care about hash uniformity, not adversarial resistance. Don't use v5 for anything security-sensitive; use it for keys.

How random are these UUIDs really?

All random bits in this tool come from crypto.getRandomValues — the browser's cryptographically secure PRNG, seeded from the operating system's entropy pool (/dev/urandom on Linux/macOS, BCryptGenRandom on Windows). That's the same entropy source your browser uses for TLS session keys and WebCrypto operations. For v4, that gives 122 bits of entropy per UUID — collision probability is negligible even at planet-scale ID generation (you'd need to generate about 2.7 quintillion UUIDs to have a 50% chance of a single collision). For v7, you get 74 bits per UUID within the same millisecond, which is still ample. This tool never uses Math.random(), which is not cryptographically secure and would make UUIDs predictable — an important distinction if you use random UUIDs as session tokens or unguessable resource IDs.

Output formats — canonical, uppercase, hex, braces, URN

The RFC defines the canonical string form: 32 lowercase hex digits grouped as 8-4-4-4-12 with hyphens. That's what almost every library and database accepts. Uppercase canonical is a common Windows / .NET style — some SQL Server projects prefer it, though the RFC recommends lowercase. Hex only strips the hyphens, useful for putting a UUID in a URL path segment or an environment variable where hyphens are awkward. Braces{8-4-4-4-12} — is the format Windows GUIDs typically use in configuration files and PowerShell output. URNurn:uuid:8-4-4-4-12 — is the fully-qualified form defined by RFC 4122 §3, useful when you need to be unambiguous about the identifier type in a multi-scheme system. All formats decode back to the same 128-bit UUID.

Tool FAQs

Everything you need to know about using UUID Generator.

What's the chance of two v4 UUIDs colliding?+

Vanishingly small. v4 has 122 bits of entropy (128 bits minus 4 for the version and 2 for the variant). Using the birthday-problem approximation, you'd need to generate about 2.71 × 1018 UUIDs to have a 50% probability of a single collision — that's generating 1 billion UUIDs per second continuously for 85 years. For all practical purposes, treat v4 collisions as impossible. The much more likely failure mode is a buggy RNG (which is why this tool uses crypto.getRandomValues, not Math.random()).

Should I use v4 or v7 for my database primary key?+

Use v7 if your database supports it. Both give you random-looking, unpredictable IDs, but v7 sorts by generation time, which keeps inserts clustered at the end of the B-tree index instead of scattered across it. For large tables (tens of millions of rows) the difference is dramatic — v4 primary keys can slow inserts by 10x or more once the table exceeds RAM, because each insert dirties a random page. Postgres, MySQL 8+, SQLite, and SQL Server all handle v7 as a plain UUID column — no schema changes needed. The only reason to still use v4 as a PK is if you have older tools or ORMs that specifically detect v4 versions.

Can someone tell when a v7 UUID was generated?+

Yes — the first 48 bits are Unix milliseconds, in the clear. If leaking creation time is a concern (for private user IDs, secret tokens, anything where the timestamp is sensitive), use v4 instead. For most application-level IDs (rows, events, requests) the timestamp is fine and often useful — you can approximate creation-time range scans by scanning by ID. v1 has the same property (in a more obfuscated form); only v4 and v5 hide all temporal information.

Is v5 secure? Can I use it for tokens?+

No. v5 is deterministic — the same inputs always produce the same UUID — and it uses SHA-1, which is publicly broken for collision resistance. It's designed for identifier stability, not secrecy. If an attacker can guess your namespace and name, they can compute your UUID. That makes v5 great for internal keys derived from external identifiers, and terrible for session tokens or CSRF tokens. Use v4 (or a proper random token) for anything that must be unguessable.

Why does v1 not use my MAC address?+

The original RFC 4122 v1 spec called for the machine's MAC address as the node identifier, which turned out to be a privacy disaster — every v1 UUID a machine generated could be traced back to it. RFC 4122 §4.5 explicitly permits (and modern implementations always use) a random node with the multicast bit set to distinguish it from a real MAC. This tool follows that convention: the node is 46 bits of random data per browser session, with the multicast bit set. Your MAC address never leaves your machine.

What are the NIL and MAX UUIDs for?+

The NIL UUID00000000-0000-0000-0000-000000000000 — is the RFC 4122 sentinel for "absent" or "not set". Some ORMs use it as a default value for uninitialised UUID columns. The MAX UUIDffffffff-ffff-ffff-ffff-ffffffffffff — was added in RFC 9562 as the sortable-maximum counterpart, useful in range-query bounds and default-max situations. Neither is a valid randomly-generated UUID (both fail version and variant checks), so they're safe to use as unmistakable sentinels.

Does this tool send my UUIDs to a server?+

No. All generation happens entirely in your browser using crypto.getRandomValues and, for v5, crypto.subtle.digest('SHA-1', …). Open your browser's Network tab to confirm zero requests fire while you generate. That matters because random values are secrets — the moment they touch a network they could be logged. This tool generates them, shows them to you, and forgets them when you close the tab.