HomeDeveloper ToolsUUID Generator
🔑 Cryptographic GUID Generator

Random v4 UUID / GUID Generator

Generate RFC 9562 (formerly RFC 4122) version 4 UUID strings in bulk for primary keys, API tokens, and database identifiers, using your browser's cryptographic random number generator.

Generated UUID List (5)

Inside a version 4 UUID

A UUID is a 128-bit identifier written as 32 hexadecimal digits in five groups of 8, 4, 4, 4 and 12 characters. The format is now specified by RFC 9562, published in 2024, which replaced the long-standing RFC 4122.

In version 4, 122 of the 128 bits are random. The remaining six are fixed: the first digit of the third group is always 4, marking the version, and the first digit of the fourth group is always 8, 9, a or b, marking the standard variant. In 3f2b8c1e-9d4a-4c7b-a1e2-5f6d7c8b9a0e you can spot both.

Randomness quality matters more than the maths

With 122 random bits there are about 5.3 x 10^36 possible values. Even by the birthday bound, you would need around 2.7 x 10^18 UUIDs before the chance of a single duplicate reached 50 percent.

Real-world duplicates come from poor random number generators, not from those odds. Cloned virtual machines with the same seed and libraries using a predictable generator have both caused collisions. This generator uses the browser's crypto.randomUUID, which draws from a cryptographically secure source. Where that function is unavailable, such as on pages not served over HTTPS, it builds the version 4 UUID from 16 bytes of crypto.getRandomValues, the same secure source. It never uses Math.random.

Version 4 versus version 7 for database keys

Random v4 values are spread evenly across the key space, so each insert lands on a random page of a B-tree index. On large tables this causes page splits and poor cache use, which is most noticeable where the primary key is also the clustered index, as in MySQL's InnoDB.

Version 7, introduced in RFC 9562, starts with a 48-bit Unix timestamp in milliseconds followed by random bits. New values sort roughly in creation order, which keeps index inserts at the end of the tree. Version 1 also contains a timestamp but traditionally embeds the machine's MAC address, which leaks information. This tool generates v4 only, which remains a good fit for IDs exposed in URLs, idempotency keys and records in smaller tables.

Storage format matters too. A UUID as text takes 36 characters, while PostgreSQL's native uuid type or MySQL's BINARY(16) stores the same value in 16 bytes.

Case, hyphens and compatibility

RFC 9562 says UUIDs should be output in lowercase and accepted in either case. Microsoft tools traditionally display GUIDs in uppercase, often wrapped in braces, so the uppercase option helps when pasting into .NET code, Windows registry files or SQL Server scripts.

Removing hyphens gives a 32-character string that is handy in file names and compact URLs. Some parsers insist on the hyphenated form, so check before storing hyphen-less values in a column or API that validates UUIDs.

UUID Generator: frequently asked questions

What is the difference between a UUID and a GUID?

They are the same thing. GUID, globally unique identifier, is Microsoft's name for the format, while UUID is the name used in the RFC. The only practical differences are display conventions such as uppercase letters and surrounding braces.

How can I tell which version a UUID is?

Look at the first character of the third group. In 3f2b8c1e-9d4a-4c7b-a1e2-5f6d7c8b9a0e it is 4, so this is a version 4 UUID. A 7 there means version 7, and a 1 means version 1.

Can I use a UUID as a password reset token or API key?

A v4 UUID from a secure generator has 122 random bits, which is hard to guess, but RFC 9562 advises against assuming UUIDs are unguessable. For secrets, generate random bytes from a cryptographic library and encode them, which also lets you choose a longer length.

Should I store UUIDs as strings in my database?

Use a native type where one exists. PostgreSQL's uuid type stores 16 bytes and validates the format. In MySQL, BINARY(16) with conversion functions is more compact than CHAR(36), which matters once the key is repeated in every index and foreign key.

What is the nil UUID?

It is the special value 00000000-0000-0000-0000-000000000000, with all bits set to zero. It is used as a placeholder meaning no value. RFC 9562 also defines a max UUID with every bit set to one, written with all f characters.

All developer utilities & crypto