UUID Generator

By Asira Tools Team · Last updated 20 November 2026

Generate one or many random UUID version 4 identifiers in the standard 8-4-4-4-12 format, ready to paste into your database, API, or config file.

Advertisement

UUID Generator

5 UUIDs generated
Version4 (random)
Format8-4-4-4-12 hex digits

UUIDs are generated with your browser's cryptographic random number generator (crypto.getRandomValues). Nothing is sent to a server.

UUID v4 format:

xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx, where each x is a random hexadecimal digit and y is 8, 9, a, or b. The 4 marks version 4; y marks the variant.

What Is a UUID?

A UUID, or Universally Unique Identifier, is a 128-bit label used to identify information in computer systems. It looks like a string of 32 hexadecimal digits separated by hyphens into five groups: 8 digits, then 4, then 4, then 4, then 12. A typical example is f47ac10b-58cc-4372-a567-0e02b2c3d479. UUIDs are designed so that any computer, anywhere, can generate one without asking a central authority, and the chance of two of them ever being the same is so small that developers treat them as unique.

That property is what makes UUIDs so useful. If you need a unique ID for a database row, a file, a user session, or an API resource, you can generate a UUID on the spot instead of asking a server to hand out the next number in a sequence. Two devices that have never talked to each other can both generate UUIDs at the same time and still be confident the IDs will not collide. UUIDs are defined by RFC 9562, the internet standard published in May 2024 that replaced the older RFC 4122.

The Anatomy of a UUID Version 4

This generator produces version 4 UUIDs, which are built from random numbers. Of the 128 bits, 122 are random. The other 6 bits are fixed so that anyone reading the UUID can tell which version and variant it is. The version is stored in the first digit of the third group: for a version 4 UUID, that digit is always 4. The variant is stored in the first digit of the fourth group, which is always 8, 9, a, or b. Those two fixed digits are the fingerprint of a v4 UUID, and you can check any UUID by looking at those two positions.

The remaining 122 random bits give 2 to the power of 122 possible values, which is about 5.3 x 10^36, or 5.3 undecillion. That number is hard to picture: it is roughly a thousand times larger than the estimated number of atoms in the observable universe would be if you counted only a tiny fraction of them, and it is far larger than any system will ever need. The randomness comes from your browser's cryptographic random number generator, crypto.getRandomValues, which is the same source of randomness used for secure web connections. It is not the weaker Math.random function, which should never be used to generate identifiers that need to be unpredictable.

How to Use This Generator

Enter how many UUIDs you need, from 1 to 100, and click Generate UUIDs. The list appears in the text box, one UUID per line, ready to copy. Use the Copy all button to copy the whole list to your clipboard in one click. Changing the count regenerates the list automatically, so you can quickly try different batch sizes. Every UUID is generated locally in your browser: nothing is sent to a server, nothing is logged, and no two visits to this page will produce the same list.

For most jobs, generate a few more UUIDs than you need and keep the extras in a scratch file. They cost nothing to make, and having spares on hand saves a trip back to the generator when a new table, test case, or config entry needs an ID.

UUID Versions Compared

Version 4 is the most common, but it is not the only version. Version 1 UUIDs are built from the current time plus the machine's network card address. They are unique and roughly time-ordered, but they leak the time they were created and the hardware address of the machine, which is a privacy problem, so they have fallen out of favor. Version 3 and version 5 UUIDs are name-based: they hash a namespace plus a name, using MD5 for version 3 and SHA-1 for version 5. The same name always produces the same UUID, which is useful when you need a stable ID derived from something like a URL, but it means they are not random at all.

Two newer versions arrived with RFC 9562. Version 6 is a reordered version 1 designed so UUIDs sort in creation order, which helps database indexes. Version 7 combines a Unix timestamp in milliseconds with random bits, giving UUIDs that are both time-ordered and random, and it is quickly becoming the recommended choice for database primary keys. Version 8 is reserved for custom formats. For a general-purpose random identifier with no special ordering needs, version 4 remains the simplest and most widely supported choice, and it is what this tool generates.

How Likely Is a Collision?

The honest answer is: so unlikely that you can ignore it. With 122 random bits, the birthday paradox says you would need to generate about 2.7 quintillion UUIDs, that is 2.7 x 10^18, before the chance of a single duplicate reaches 50 percent. To put that in perspective, if every computer on earth generated one billion UUIDs per second, it would take about 86 years to reach that point. In practice, systems generate a tiny fraction of that volume, so the real-world collision probability is effectively zero.

There is one caveat, and it matters: the math only holds if the random numbers are genuinely random. A UUID generator built on a weak or seeded random source, or one that reuses the same random values, can produce duplicates far more often than the theory allows. That is why this tool uses the browser's cryptographic generator rather than a simple pseudo-random function. If you generate UUIDs in your own code, use your platform's secure random source, such as crypto.randomUUID in modern JavaScript, uuid4 in Python, or java.util.UUID.randomUUID in Java.

Where UUIDs Are Used

UUIDs show up almost everywhere in modern software. Databases use them as primary keys, especially in distributed systems where several servers insert rows independently and cannot share a single auto-incrementing counter. APIs use them as resource IDs in URLs, because a random ID does not reveal how many records exist, unlike a sequential number that tells anyone browsing that your ten-thousandth user just signed up. They also appear as session tokens, file names for uploads, correlation IDs that tie together log entries from one request across many services, and identifiers for Bluetooth devices, documents, and test fixtures.

One place UUIDs are not ideal is as a database primary key in a table that grows very large and is indexed in insertion order, because random UUIDs scatter new rows across the index instead of appending them at the end. If that matters to you, look at UUID version 7, which keeps the randomness but sorts by creation time. For everything else, version 4 is the safe default.

Worked Example: Reading a UUID

Take the UUID f47ac10b-58cc-4372-a567-0e02b2c3d479. Reading it from left to right: the first group, f47ac10b, is 8 random hex digits. The second group, 58cc, is 4 more random digits. The third group, 4372, starts with 4, which tells you this is a version 4 UUID. The fourth group, a567, starts with a, which is one of the four allowed variant digits (8, 9, a, b) and confirms the standard variant. The final group, 0e02b2c3d479, is 12 random hex digits. Strip out the hyphens and you have 32 hex digits, which is exactly 128 bits. Every UUID this generator produces follows the same pattern, and you can verify any of them by checking that the 13th hex digit is 4 and the 17th is 8, 9, a, or b.

Tips and Common Mistakes

Store UUIDs as text or as binary, not as a number. A UUID does not fit in a 64-bit integer, so storing it in a numeric column will overflow. Most databases have a native UUID type, which stores the 16 bytes efficiently; if yours does not, use a 36-character text column.

Do not use UUIDs as passwords or secret tokens on their own. A version 4 UUID has 122 bits of randomness, which is plenty for an identifier, but it is not a substitute for a properly designed authentication token with expiry and revocation. Use UUIDs to identify things, and use a real token system to protect them.

Do not assume UUIDs sort in creation order. Version 4 UUIDs are random, so sorting them gives you a meaningless order. If you need time ordering, use version 7 or store a separate created-at timestamp.

Watch the case. UUIDs are case-insensitive, and this generator outputs lowercase, which is the convention in RFC 9562. Some systems output uppercase. When comparing UUIDs, normalize the case first or your lookups will miss.

Keep the hyphens unless a system asks you to remove them. The hyphenated 36-character form is the standard display format. Some databases and APIs accept the 32-character form without hyphens, but the hyphenated form is the one people recognize, so use it unless you have a reason not to.

Advertisement

Frequently Asked Questions

What is a UUID v4?

A version 4 UUID is a 128-bit identifier built from 122 random bits, written as 32 hexadecimal digits in five hyphenated groups (8-4-4-4-12). The 13th hex digit is always 4, marking version 4, and the 17th is 8, 9, a, or b, marking the variant.

Can two UUIDs ever be the same?

In theory yes, in practice no. With 122 random bits there are about 5.3 x 10^36 possible v4 UUIDs, and you would need to generate around 2.7 quintillion of them before the chance of one duplicate reached 50%. For any real system the risk is effectively zero.

Are UUIDs generated here random and safe to use?

Yes. This tool uses your browser's cryptographic random number generator (crypto.getRandomValues), the same source used for secure web connections, and every UUID is generated locally. Nothing is sent to a server or stored.

What is the difference between UUID v4 and v7?

Version 4 is fully random, so UUIDs do not sort in creation order. Version 7 starts with a Unix timestamp in milliseconds followed by random bits, so UUIDs sort by creation time, which makes it better for database primary keys. Version 4 is the simplest general-purpose choice.

How many UUIDs can I generate at once?

Up to 100 per batch with this tool. Enter the count, click Generate UUIDs, and use Copy all to copy the whole list. For larger volumes, generate them in your own code with a library function such as crypto.randomUUID() in JavaScript or uuid4() in Python.