UUID Generator

Create a single or many universally unique identifiers in an instant, RFC 4122 compliant, cryptographically random, easily copied or exported.

Works in your browser without requiring any downloads. No data is logged, stored or sent to a server that you create.

Generator Settings

Formatting Options

What Is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit identifier for something, such as a database record, a user session, an API request, with the idea being that it should be impossible to get a central authority to allocate the numbers. One can be created on any machine, anywhere, and the chance of two systems creating the same one by chance is insignificant.

A UUID can be represented as 5 sets of 12 hexadecimals separated by hyphens: 8-4-4-4-12:
f47ac10b-58cc-4372-a567-0e02b2c3d479

The same idea, Microsoft's name for the standard: GUID (Globally Unique Identifier). In practice, "UUID" and "GUID" are used interchangeably.

Why not a standard sequential ID?

The classic auto-increment primary key (1, 2, 3, 4...) is useful in a single database, but fails if multiple servers/services independently create records at the same time (two servers might get the same "next" number at the same time). To overcome this, UUIDs are created independently and have no need for coordination or central counter, which makes them almost certain to be unique.

In addition to the security aspect: sequential IDs provide information. If your invoice URL is /invoice/1042, then anyone can clearly deduce that there is an invoice /invoice/1041 which probably belongs to a real customer. /invoice/f47ac10b-58cc-4372-a567-0e02b2c3d479 says nothing about the number of records or whether they're valid.

UUID Versions, Explained

Some UUIDs are not created the same, the version number (first digit of the third group) gives you the clue about the way it was created.

Version How It's Generated Best For
v1 Time stamp + device mac address Legacy systems; ill advised these days - can leak device and time info.
v3 Deterministic hash (MD5) of a namespace + name Consistently generating the same UUID with the same input each time
v4 Random number generator yielding only truly random numbers. This is the most used version, for general-purpose use.
v5 An attribute that is the deterministic hash of a namespace + name. Identical to v3, but with a better hash algorithm.
v7 As of today, timestamp + random bits, sorted by creation time Up to date database primary keys, which is a combination of the uniqueness and chronological sorting.

v7 is the one that is catching on the fastest right now: it contains a timestamp, so in practice, records sort naturally in creation order which resolves a real performance issue with v4 in database indexes — random UUIDs are strewn across an index, while with v7, they are naturally sorted in order of creation, which can slow down inserts at scale.

What's the uniqueness of a v4 UUID?

A UUID is 128 bits overall, but 6 of these bits are reserved as part of the version and variant number, leaving 122 bits of actual randomness, which is 2¹²² combinations (or 5.3 undecillion, meaning a 5 followed by 36 zeros).

For comparison, if you produced on billion of UUIDs per second every second for the next 85 years, you would only have about a 50% chance of obtaining a duplicate UUID. The collision risk is assumed to be zero in essentially any real-world application.

Frequently Asked Questions

What is UUID and is it a GUID?

Functionally, yes. The general standard is called UUID (described in the RFC 4122), and Microsoft's version of the same is called GUID. In almost every practical scenario they can be interchanged.

What's the recommended UUID version for the default?

For most use cases, e.g., database keys, session tokens, general-purpose unique IDs, Version 4 (random) is the default option. Only use v1, v3, v5, or v7 for a specific reason: v7 for time-sortable IDs, v3/v5 if you must use the same input to always get the same UUID.

Is it possible to get the same UUID by coincidence in two systems?

It might theoretically be possible, but the odds are so low that it would take decades of generating more than a billion UUIDs per second before a collision even became moderately likely. In effect, it's considered impossible in practice.

Should UUIDs be exposed to a public URL?

Yes, generally, and in fact it's one of the more prevalent uses, as with sequential IDs, a UUID doesn't provide any clues on how many records exist or enable someone to guess neighbouring IDs. However, if the resource is sensitive, a UUID is not an alternative to proper authentication; once the UUID is known to any user (by being included in a shared URL, in the history of the browser, or in the referrer header of a request) it can be used to access the resource as well.

Why a UUID is always in the 8-4-4-4-12 format?

That group is described by the RFC 4122 standard, making all UUIDs consistent in structure, regardless of the system or programming language used to generate them, and easy to validate.

Is there a way to create many UUIDs?

Yes — the majority of UUID generators, including this one, will allow you to specify a quantity and create hundreds or thousands of UUIDs at a time — a good alternative for seeding test data or populating a set of records in advance.

Are UUID never expired or invalid?

No — once a UUID is created it remains constant. There is no expiration period, and it is not tied to a period of time as an identifier in its own right—unless the program logic you are using requires it to expire for some other reason.

What's a "nil UUID"?

The nil UUID is a special reserved value where every character is zero (00000000-0000-0000-0000-000000000000). It's used to represent "no UUID" or an unset value in code, similar to how null represents an absent value.

Share This Tool

Browser Extension

Get quick access to remove the gemini watermark from the image and video directly from your browser toolbar.