🆔

UUID Generator

✓ Free & no signup 🔒 Runs 100% in your browser Updated 2026-11-25 Website Management Tools

A UUID, universally unique identifier, is a 128-bit label designed so that identifiers generated independently, on different machines, at different times, by different teams, never collide. This tool generates UUID version 4 values in your browser: pick a batch size of 1, 5, 10, or 25, optionally switch to uppercase, and copy the whole list with one click. Everything happens locally using your browser's cryptographic random number generator, nothing is transmitted or stored, and the page works on mobile as well as desktop.

The reason UUIDs exist is a practical database and distributed-systems problem. Sequential integer IDs force every part of a system to coordinate: a central counter, a round trip to the database, a locking protocol. A UUIDv4 replaces that coordination with randomness so strong that the probability of two independently generated identifiers ever matching is, for any realistic workload, effectively zero. You can generate IDs offline, on a plane, in a distributed worker fleet, and merge everything later without a single conflict.

This page also explains what those random bits actually mean, how the collision math works with real numbers, and how version 4 relates to the other UUID versions you will encounter in the wild.

What a UUID Looks Like, Piece by Piece

A UUID is 32 hexadecimal digits displayed in the canonical 8-4-4-4-12 grouping, like this real generated example:

3f9a2c7e-81b4-4d6a-9e2f-5c8b1a7d3e60

Every character carries meaning in the version layout:

  • The third group's first digit is the version. Here it is 4, marking a random UUID. You will see 1 for time-based, 3 and 5 for name-based, and increasingly 7 for the modern time-ordered format.
  • The fourth group's first digit encodes the variant, telling parsers which specification family the UUID follows. Version 4 UUIDs show 8, 9, a, or b there.
  • The remaining 122 bits are pure randomness, drawn from a cryptographically secure source.
  • Length is always exactly 36 characters including the four hyphens, or 32 without them, which is convenient for validating input and sizing database columns.

How to Use This Tool (Step by Step)

  1. Choose how many UUIDs you need: 1, 5, 10, or 25 per batch. Generating 25 at once and trimming the list is usually faster than requesting them one at a time.
  2. Toggle uppercase if your target system expects it. The characters are identical in either case; hex digits a-f and A-F represent the same values, but some downstream systems are picky about formatting, so match their convention.
  3. Generate. The batch appears instantly, drawn fresh from the cryptographic random source every time.
  4. Use copy-all to grab the entire list, one UUID per line, ready to paste into a spreadsheet, seed file, or script.
  5. Generate another batch any time. Identifiers from separate runs are no more likely to collide than identifiers within one run, which is the whole design goal.

The Randomness and the Collision Math

Version 4 UUIDs reserve 6 of their 128 bits for version and variant markers, leaving 122 bits that vary randomly. That number sounds abstract until you put it in perspective: 122 bits is a space of 2 to the power 122, which is about 5,316,000,000,000,000,000,000,000,000,000,000,000, or roughly 5.3 x 10 to the 36th, possible values. Written out, more than five thousand billion billion billion billion.

Collisions follow a birthday-problem curve, and the honest numbers are striking:

  • Generate 1 billion UUIDs per second, every second, and the expected time until the first collision is on the order of 100 years.
  • Generate just 2.7 quintillion (2.7 x 10 to the 18th) UUIDs and the chance of even one duplicate is still only one in a billion.
  • For a typical application generating thousands or millions of identifiers, the probability of any collision ever is so close to zero that it is not a design consideration at all.

The engineering conclusion: with a proper cryptographic random source, you never need to check whether a generated UUID already exists. That check is not wrong, just unnecessary, and removing it simplifies distributed workflows considerably.

Where the randomness comes from matters. This tool uses the browser's crypto.randomUUID function when available, backed by a cryptographically secure pseudorandom number generator seeded from your operating system's entropy pool, and falls back to crypto.getRandomValues, the same CSPRNG API, otherwise. Neither is a Math.random equivalent: Math.random is fast but predictable enough that its output can be reconstructed from a few observations, which makes it categorically wrong for identifiers where unpredictability matters, such as session tokens. A CSPRNG output resists prediction even given previous outputs.

UUID Versions at a Glance

VersionBuilt fromTypical use
v1Timestamp plus MAC addressLegacy systems; leaks hardware identity and time
v3MD5 hash of a namespace and nameDeterministic IDs from names; MD5 is deprecated
v4122 random bitsThe default choice for almost everything
v5SHA-1 hash of a namespace and nameDeterministic IDs, same input always gives same output
v7Millisecond timestamp plus random bitsModern time-ordered IDs that index well in databases

Version 4 versus version 5 is the distinction worth remembering. V4 is random: the same input, generated twice, gives different outputs, which is what you want for entity identifiers. V5 is deterministic: hashing the same namespace and name always produces the same UUID, which is useful when independent systems must derive identical identifiers from a shared name without communicating, such as mapping a domain name to a fixed identifier. If you need reproducibility, you want v5, not v4; this tool generates v4, the general-purpose default.

Version 7 deserves a mention because databases pushed it into fashion. Random v4 values scatter across a B-tree index, causing page splits and cache misses at scale, so systems inserting millions of rows increasingly prefer v7, whose leading timestamp keeps new identifiers ordered, playing nicely with indexes while retaining random tail bits for uniqueness. If you control the UUID version choice in a high-write system, it is worth researching; for typical application volumes, v4 remains entirely fine.

Common Use Cases

  • Database primary keys: UUIDs allow client-side ID generation, safe merging of data from multiple sources, and offline-first apps that sync later without conflicts.
  • API request and trace identifiers: stamp every request with a UUID so logs across services can be correlated during debugging.
  • File and object names: an uploaded file renamed to a UUID avoids filename collisions, path traversal problems, and leaking original names.
  • Test fixtures and seeds: batches of identifiers for staging data, integration tests, and demo accounts, generated in one paste.
  • Public-facing references: order numbers, share links, and confirmation codes where you prefer an unguessable identifier over a sequential count that reveals your volume.

One Honest Caveat: Unpredictability Is Not Secrecy

UUIDv4 identifiers are hard to guess, with a 1 in 5.3 x 10 to the 36th chance of hitting a specific value, and that property is genuinely useful for unguessable share links and reference codes. But an unguessable identifier is an authentication mechanism only if you treat it as a secret: it must travel over HTTPS, must not appear in logs or analytics URLs, and should not be the sole gate to sensitive data. Resources protected only by an unlisted UUID leak through referrer headers, browser history, and shared screenshots. Use UUIDs as identifiers first and unguessable tokens second, and keep real authorization behind accounts and permissions.

Tips and Best Practices

  • Store UUIDs efficiently in databases: as a 16-byte binary or the native UUID column type rather than 36-character text, which cuts storage and speeds comparisons.
  • Do not sort or parse UUID strings as numbers; they are opaque labels. Only v1 and v7 encode meaningful time, and even then, sorting rules differ.
  • Validate external input with the canonical format: 36 characters, four hyphens at fixed positions, hex digits only, with the version and variant nibbles in range.
  • For bulk seed data, generate the batch once, save it in version control, and reuse the same fixture list across test runs for reproducibility.
  • When several systems must derive the same identifier from the same name independently, switch to a v5 tool rather than pre-generating and syncing v4 lists.

Frequently Asked Questions

What are the odds of two random UUIDs colliding?
Version 4 UUIDs carry 122 random bits, about 5.3 times 10 to the 36th possible values. Birthday-problem math says generating 2.7 quintillion UUIDs still leaves only a one-in-a-billion chance of a single duplicate, and generating a billion UUIDs per second for around 100 years is the expected timeline for the first collision. For any realistic application, the probability is so negligible that collision checks are unnecessary. The caveat is that this assumes a cryptographically secure random source, which browsers provide through crypto.randomUUID and getRandomValues.
What is the difference between UUID v4 and v5?
V4 is purely random: generate it twice and you get two different identifiers, which suits entity IDs where uniqueness is the goal. V5 is deterministic: it hashes a namespace plus a name with SHA-1, so the same input always yields the same UUID, which suits cases where independent systems must derive identical identifiers from a shared name without communicating. Practical rule: use v4 for records, users, and orders; use v5 when reproducibility from a name matters, such as mapping domains or stable resource names to fixed identifiers. This tool generates v4.
Can I use UUIDs as unguessable URLs or access tokens?
Partially. A v4 UUID is effectively impossible to guess, about 1 in 5.3 times 10 to the 36th, which makes it fine for unlisted share links and reference codes. But unguessable is not the same as secret: UUIDs in URLs leak through browser history, referrer headers, logs, and shared screenshots, and they cannot be revoked or rotated like real credentials. Treat a UUID-gated resource as lightly protected at best, keep such URLs off analytics and logs, and put real authorization behind accounts and permissions for anything sensitive.
Why do UUIDs have hyphens and a fixed format?
The canonical format is 32 hexadecimal digits in five groups, 8-4-4-4-12, separated by four hyphens, 36 characters total. The hyphens are purely for readability and validation, not data: many systems strip them for storage. The positions are meaningful though, because the first digit of the third group encodes the version, 4 for random, and the first digit of the fourth group encodes the variant. That layout lets any parser identify the UUID type at a glance, which is why the format is specified so strictly across languages and databases.
Is Math.random okay for generating unique IDs?
No, if uniqueness or unpredictability matters. Math.random is a fast pseudorandom generator that is not cryptographically secure, and its sequence can in principle be reconstructed from observed outputs, which rules it out for session identifiers and security-sensitive tokens. Even for plain uniqueness, its entropy budget is far smaller than the 122 bits a v4 UUID provides. Browsers offer crypto.randomUUID and crypto.getRandomValues, backed by a CSPRNG seeded from the operating system's entropy pool, at no meaningful speed cost, so there is no good reason to reach for Math.random for identifiers.
Should I use UUIDs or auto-increment integers as primary keys?
It depends on your architecture. Auto-increment integers are smaller, faster to index, and human-friendly, but they require a central sequence, expose your record counts, and make multi-master or offline-first writes painful. UUIDs generate anywhere with zero coordination, merge cleanly, and can be created client-side before any database round trip. The classic trade-off is index locality: random v4 values scatter across B-trees, which is why high-write systems often pick time-ordered v7. For typical application volumes, v4 works well; for massive insert throughput, research v7 or keep integers with a coordination layer.

Related Tools