Skip to content
Utilboxes

UUID Generator

Choose random version 4 UUIDs, or time-ordered version 7 for database keys, set how many — up to ten thousand — and pick a format, then copy or download them. Version 7 sorts by creation time and keeps indexes compact; version 4 suits public tokens. Both validate against RFC 9562.

Runs entirely in your browser

Updated

How to use the UUID Generator

  1. 1Choose the UUID version you need.
  2. 2Set how many to generate.
  3. 3Pick a format: standard hyphenated, uppercase, braced, or no hyphens.
  4. 4Copy the list, or download it as a text file.

How it works

A UUID is a 128-bit identifier that can be created independently anywhere without coordination, and still be unique in practice. Version 4 fills 122 of those bits with cryptographic randomness — enough that generating a billion a second for a century still leaves the chance of a collision negligible.

Version 7 solves a real problem with version 4. Random UUIDs arrive at a database in random order, which scatters writes across a B-tree index and fragments it badly. Version 7 puts a 48-bit millisecond timestamp at the front, so identifiers generated later sort later. Inserts land at the end of the index, and range queries by time become possible.

The trade-off is that version 7 leaks approximately when the identifier was created. For an internal primary key that is usually fine; for a public unguessable token, version 4 is the safer choice.

Both versions set the version and variant bits correctly, so the output validates against RFC 9562.

Worked example

Reading the structure of a UUID

  1. 0189d5f2-1e4c-7a3b-9c2d-4e5f6a7b8c9d
  2. The 13th character is the version — 7 here.
  3. The 17th character encodes the variant, always 8, 9, a or b.

Result: A valid RFC 9562 version 7 UUID whose first 48 bits are a timestamp.

Tips and common mistakes

  • Use version 7 for database primary keys; it keeps inserts in order and indexes compact.
  • Use version 4 for anything that must not reveal when it was created, such as public tokens.
  • Store UUIDs in a native UUID column where your database has one; it takes less space than text.
  • Use lower case in the standard hyphenated form unless a system needs something else.

Frequently asked questions

Should I use UUID v4 or v7?
v7 for database primary keys, because it sorts by creation time and keeps indexes compact. v4 for public tokens and anything where the creation time should not be inferable.
Can two UUIDs ever be the same?
In theory yes, in practice no. With 122 random bits you would need to generate around 2.7 × 10¹⁸ of them before a collision became likely.
Do I need to worry about the format?
The hyphenated lowercase form is the standard and works everywhere. Braced and uppercase variants exist mainly for older Microsoft tooling.
How many can I generate at once?
Up to ten thousand in one go, which is enough to seed a test database.
What is a GUID?
Microsoft's name for a UUID. They are the same 128-bit identifiers, sometimes written in braces or in upper case.
What is the NIL UUID?
The UUID made entirely of zeros, 00000000-0000-0000-0000-000000000000. It is used as an explicit “no value”.
Are version 4 UUIDs safe to use as secret tokens?
They are generated with cryptographic randomness and are practically impossible to guess. Do not use version 7 for this, because part of it is a timestamp.

Guides