UUID generator

Unique IDs for databases, APIs and tests, in one click.

Format

Runs in your browser. Nothing you type is sent anywhere.

How to generate a UUID

  1. Pick version 4 for random IDs, or version 7 for IDs that sort by time.
  2. Set how many you need and the format.
  3. Click Generate, then copy or download the list.

UUID versions compared

VersionBuilt fromSorts by time?
v4 (this tool)122 random bitsNo
v7 (this tool)48-bit timestamp plus random bitsYes
v1 (not offered here)Timestamp plus the machine's MAC addressYes, but can leak which machine made it

UUID structure, per RFC 9562

PartLengthMeaning
Version nibble1 hex digit4 for version 4, or 7 for version 7, in the 3rd group
Variant bitsTop 2 bits of the 4th groupSet to 10 for this RFC's UUID variant
Total length36 characters32 hex digits plus 4 hyphens

Tips for using UUIDs

  • Store UUIDs in a native UUID or 16-byte binary column when your database offers one. Storing them as 36-character text roughly doubles the space each one takes.
  • Version 7's leading timestamp makes IDs sort by creation time, but it also means anyone holding an ID can tell roughly when it was made, down to the millisecond.
  • Braces and no-hyphen formatting match how some older Windows APIs and PowerShell scripts expect a GUID to look.

UUID generator FAQ

What is the difference between UUID v4 and v7?

Version 4 is 122 random bits. Version 7 starts with a 48-bit timestamp in milliseconds followed by random bits, so newer IDs sort after older ones.

Can two UUIDs ever be the same?

In practice, no. You would need to generate about 103 trillion version 4 UUIDs for a one in a billion chance of a single duplicate.

Is a GUID the same as a UUID?

Yes. GUID is the name Microsoft uses for the same 128-bit format. Tick Uppercase and Braces for the {XXXXXXXX-XXXX-...} style used in Windows and .NET.

Which version should I use for a database primary key?

Version 7. Its values arrive in time order, so new rows land at the end of the index instead of at random spots, which keeps inserts fast. Use version 4 when an ID must not reveal when it was made.

Can I use a UUID as a password or secret token?

The random bits come from your browser's cryptographically secure generator, but a UUID is meant as an identifier. Version 7 IDs also expose their creation time, so use a password generator for secrets.

How long is a UUID?

36 characters when hyphenated: 32 hex digits and 4 hyphens, encoding 128 bits of data in total.

Does this use a cryptographically secure random source?

Yes. Both versions are built from crypto.getRandomValues (or crypto.randomUUID for version 4), the browser's cryptographically secure random number generator, never Math.random.

Related tools