UUID Generator

Generate proper RFC 4122 version 4 UUIDs, the random kind used by databases, APIs and apps everywhere. Every value is built from cryptographically secure random bytes in your browser, with the version and variant bits set exactly as the standard requires.





Illustration of hexadecimal tiles and a key for the UUID Generator that creates version 4 identifiers

What Is a UUID?

A UUID, short for Universally Unique Identifier, is a 128-bit value written as 32 hexadecimal digits in five groups: 8, 4, 4, 4 and 12, separated by hyphens, like 3f2504e0-4f89-41d3-9a0c-0305e82c3301. Microsoft calls the same thing a GUID. UUIDs exist so that any computer, anywhere, can mint an identifier that is practically guaranteed to be unique without asking a central server for permission. That property makes them the default choice for database primary keys, request and trace IDs, file names, session tokens and distributed systems of every kind.

This UUID generator produces version 4 UUIDs as defined by RFC 4122 (now updated by RFC 9562, which kept the version 4 layout unchanged). Version 4 means the value is built from random bits, 122 of them, with 6 bits reserved to declare the version and variant. The randomness comes from your browser's cryptographic random source, the same one used for security-sensitive work, not from a weak pseudo-random shortcut.

How to Use the UUID Generator

  1. Choose a quantity. Generate a single UUID or a batch of up to 50 at once, handy for seeding a test database or filling a spreadsheet.
  2. Set the format. Leave hyphens on for the standard look, switch them off for the compact 32-character form some systems expect, and tick Uppercase if your codebase uses capital GUIDs.
  3. Click Generate UUIDs. A fresh batch appears instantly. Changing the format afterwards simply re-displays the same batch in the new style.
  4. Copy what you need. Use the Copy button beside any single UUID, or Copy All to take the whole batch, one per line.

Anatomy of a Version 4 UUID

Look at the third group of any UUID from this tool and it always starts with the digit 4. That is the version field, and it tells any reader how the value was made: 4 means random. The fourth group always starts with 8, 9, a or b. That is the variant field, and it declares that this UUID follows the RFC 4122 layout rules. These fixed bits are why the regex used to validate a version 4 UUID checks exactly those two positions. A generator that forgets to set them produces strings that look like UUIDs but are not valid ones, a bug that tends to surface months later inside a strict parser. This tool sets both fields on every value, and its output is verified against the standard pattern.

How unique is unique?

With 122 random bits there are about 5.3 × 10^36 possible version 4 UUIDs. You could generate a billion of them and the chance that any two collide is roughly one in 2.7 quintillion. Collisions are so unlikely that engineers treat independently generated UUIDs as unique by construction, which is the entire point of the design: no coordination, no registry, no waiting.

UUIDs in Practice

Developers reach for UUIDs whenever records are created in more than one place: mobile apps syncing to a server, microservices writing to shared storage, or users importing data offline. Sequential integer keys leak information (a rival can guess how many customers you have from an order number) and collide the moment two databases merge; UUIDs do neither. Game developers mint them for saved worlds and player inventions, and tools like our Random Character Generator are often used alongside UUID-keyed test data when populating a demo database. If your project also needs human-facing random values, such as picking a winner or a test date, the Random Date Generator covers the readable end of the randomness spectrum.

UUID Versions at a Glance

  • Version 1 combines a timestamp with a device identifier. Ordered by time, but it can leak when and where a value was created.
  • Version 3 and 5 are name-based hashes (MD5 and SHA-1): the same input always yields the same UUID, useful for deriving stable IDs from names.
  • Version 4, generated here, is pure randomness and the overwhelming favourite for general-purpose identifiers.
  • Version 7, standardised in RFC 9562, mixes a millisecond timestamp with randomness so database indexes stay efficient while values remain hard to guess.

How a Version 4 UUID Is Built, Step by Step

Every value from this generator starts as 16 bytes of pure randomness. The browser fills them from its cryptographic random source, the same facility used to generate keys and tokens, so the bytes are not predictable from any earlier output. Six of those 128 bits are then overwritten with fixed information. Four bits in the seventh byte are set to 0100, the binary for 4, declaring the version. Two bits in the ninth byte are set to 10, declaring the RFC 4122 variant. The remaining 122 bits stay random.

Finally, the bytes are written out as hexadecimal, two digits per byte, with hyphens inserted after the 8th, 12th, 16th and 20th hex characters to form the familiar 8-4-4-4-12 pattern. That is the whole recipe, and it is why a version 4 UUID can be recognised on sight: the 4 that opens the third group and the 8, 9, a or b that opens the fourth are not decoration, they are the standard announcing itself.

Storing UUIDs in a Database

Store UUIDs in a native uuid column where your database offers one (PostgreSQL and MySQL 8 both do), or as BINARY(16) rather than CHAR(36): the binary form uses less than half the space and compares faster. Be aware that purely random primary keys scatter inserts across the index, which can fragment large tables; that is the one practical argument for time-ordered version 7 values in very high-volume systems. For the overwhelming majority of applications, test fixtures, imports and user-facing records, version 4 values like the ones generated here are the right default: simple, private and merge-proof.

Game saves and generated worlds lean on the same properties. Sandbox games mint identifiers for worlds, items and creatures so that player creations can be shared and merged without collisions, and builders who prototype those worlds in tools like our Minecraft Pixel Art Generator are working in exactly the identifier-per-object world that UUIDs were designed for.

UUIDs, GUIDs and Sequential IDs Compared

It is worth being clear about what a UUID is not. It is not a counter: unlike invoice numbers or ticket numbers, UUIDs carry no order information, so you cannot sort them to find the newest record, and you should never use one where a human must read, dictate or memorise the value. It is also not a secret: a UUID is an identifier, not a password or an unguessable token, even though random ones are hard to predict in bulk. Use proper random tokens for security boundaries and UUIDs for identity, and the two will never be confused. Where order matters and privacy does not, a plain sequence is simpler; where records are born in many places at once, or merged later, or shown to the public without revealing your volumes, the UUID wins every time. Most mature systems quietly use both, a sequential key inside the database and a UUID on everything the outside world can see.

Frequently Asked Questions

Are these UUIDs really random and standards-compliant?

Yes. Each value is built from cryptographically secure random bytes from your browser, with the version nibble set to 4 and the variant bits set to the RFC 4122 pattern, so every UUID matches the official version 4 format exactly.

What is the difference between a UUID and a GUID?

Nothing of substance. GUID is Microsoft's name for the same 128-bit identifier defined by the RFCs. A version 4 UUID from this page can be used anywhere a GUID is expected, including in .NET and SQL Server.

Can two generated UUIDs ever be identical?

In theory yes, in practice no. With 122 random bits, you would need to generate around a billion billion values before a collision became at all likely. For everyday development and testing, treat them as unique.

How many UUIDs can I generate at once?

Up to 50 per batch, which keeps the page instant even on slow devices. Run the generator again whenever you need more; there is no daily limit.

Why would I turn the hyphens off?

Some systems store UUIDs as a bare 32-character hex string, for example in compact database columns or certain APIs. The value is the same identifier; only the punctuation changes.

Is anything I generate sent to a server?

No. Generation happens entirely in your browser with its built-in cryptographic random generator. Nothing is uploaded, logged or stored, and the tool works offline once the page has loaded.

Can I use these UUIDs in production?

Yes. They are genuine RFC 4122 version 4 values created from a cryptographic random source, the same quality you would get from your programming language's standard library.

Scroll to Top