UUID Generator

Generate one or a thousand UUIDs, then copy or download them.

How to generate UUIDs

  1. Choose version 4 (random) or version 7 (time-ordered).
  2. Set how many you need (up to 1,000) and the formatting options.
  3. Click Generate, then copy them all or download a text file.

UUID format

A UUID is 128 bits written as 32 hexadecimal digits in five groups: 8-4-4-4-12, for example 3f2c9a1e-7b4d-4c8e-9a2f-1d6e5b7c8a90. The first digit of the third group is the version (4 or 7), and the first digit of the fourth group (8, 9, a or b) marks the standard RFC 9562 variant.

When to use v7

Random v4 keys are scattered across a database index, which slows inserts on large tables. UUID v7 keeps the uniqueness of UUIDs but sorts by time, like an auto-increment ID that can be generated anywhere without coordination. It is a good default for new database primary keys.

Related: Unix Timestamp Converter, Base64.

Where UUIDs are used

UUIDs are used as database primary keys, identifiers for API resources, file names for uploads, correlation IDs in logs, and keys for idempotent requests in payment systems. Their main advantage is that any computer can create one without asking a central server, and the chance of two being the same is negligible.

Generating UUIDs in code

  • JavaScript: crypto.randomUUID()
  • Python: import uuid; uuid.uuid4()
  • Java: UUID.randomUUID()
  • C#: Guid.NewGuid()
  • PostgreSQL: gen_random_uuid()
  • Command line: uuidgen on macOS and Linux

Other UUID versions

Version 1 combines a timestamp with the computer’s MAC address, which can leak hardware information. Versions 3 and 5 are derived from a name using a hash, so the same input always gives the same UUID. Version 4 is random and the most widely used. Version 7, standardized in RFC 9562 in 2024, combines a Unix timestamp with random bits and is now recommended for new database keys.

Should UUIDs be uppercase?

The standard recommends lowercase output but says parsers must accept both. Some Microsoft tools display GUIDs in uppercase with braces. Use the formatting options above to match the style your system expects.

UUIDs in URLs and file names

UUIDs are safe to use in URLs and file names because they contain only hexadecimal characters and hyphens. They are long, though: 36 characters with hyphens or 32 without. If you need shorter IDs for user-facing links, consider encoding the UUID’s 16 bytes in Base64URL (22 characters), or use a separate short code while keeping the UUID as the internal identifier.

Bulk generation for testing

Generate up to 1,000 UUIDs at once to seed test databases, create fixtures, or fill spreadsheets. Download them as a text file with one UUID per line, which can be imported into most databases or pasted straight into a spreadsheet column.

Frequently asked questions

Are these UUIDs truly random?

Version 4 UUIDs use your browser’s cryptographically secure random number generator (crypto.randomUUID), the same quality used for security keys.

What is the difference between UUID v4 and v7?

v4 is fully random. v7 starts with a millisecond timestamp, so values sort in creation order, which makes database indexes faster and more compact.

Can two UUIDs ever be the same?

In theory yes, in practice no. With 122 random bits, you would need to generate billions per second for many years before a duplicate becomes likely.

Is a GUID the same as a UUID?

Yes. GUID is Microsoft’s name for the same 128-bit identifier format.

Last updated · By the Toolbenchly team · How we build and test our tools