UUID Generator

Generate secure random v4 or time-ordered v7 UUIDs in bulk, and validate or inspect any UUID.

Runs in your browser

Options

Version

Up to 1000 at once.

32 hex digits, e.g. for compact database keys.

Output

0 UUIDs (v4)

Generating…

UUID validator & inspector

Accepts canonical, uppercase, braced, hyphen-less and urn:uuid: forms.

What is a UUID?

A UUID (Universally Unique Identifier), also called a GUID in the Microsoft world, is a 128-bit identifier written as 32 hexadecimal digits in five groups: xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx. The M digit is the version and the top bits of N are the variant. UUIDs let independent systems create IDs without a central counter, which is why they are used for database keys, API resources, file names, idempotency keys and distributed events.

UUID v4 is 122 bits of randomness. With a cryptographically secure generator the chance of a collision is negligible: you would need to generate roughly 2.7 quintillion v4 UUIDs for a 50% chance of a single duplicate. UUID v7, standardised in RFC 9562 (2024), puts a 48-bit Unix millisecond timestamp in front of 74 random bits, so new IDs sort in creation order. That keeps B-tree indexes compact and inserts fast, which makes v7 the better choice for database primary keys.

This generator uses your browser’s Web Crypto API (crypto.randomUUID() and crypto.getRandomValues()), never Math.random(). Bulk v7 UUIDs created in the same millisecond use a monotonic counter (RFC 9562, method 1) so they still sort in the order they were generated. Nothing is sent to a server.

How to use the UUID Generator

  1. Choose v4 for random IDs, v7 for time-ordered IDs (best for database keys) or Nil for the all-zero placeholder.
  2. Enter how many you need (1–1,000). A fresh batch is generated whenever you change the version or count, or click Regenerate.
  3. Pick the format: uppercase, without hyphens, wrapped in braces or quotes, one per line or as a JSON array.
  4. Copy the list or download it as a .txt or .json file.
  5. To check an existing UUID, paste it into the validator & inspector to see its version, variant and — for v1, v6 and v7 — the embedded timestamp.

Example

Three v7 UUIDs generated in the same second share a timestamp prefix and sort chronologically:

019a1f3c-8e40-7a12-9c3d-5b8e2f1a6d47
019a1f3c-8e40-7a13-8f01-c2d94e7b3a90
019a1f3c-8e41-7302-b7e5-1a6c0d9f2e84

UUID versions at a glance

  • v1 — timestamp plus the machine’s MAC address. Leaks hardware identity and creation time; avoid for public IDs.
  • v3 / v5 — deterministic hashes (MD5 / SHA-1) of a namespace and a name. The same input always gives the same UUID.
  • v4 — random. The default choice for opaque identifiers.
  • v6 — v1 with the timestamp bytes reordered so it sorts; mainly for migrating v1 systems.
  • v7 — Unix-millisecond timestamp plus randomness. Sortable and index-friendly; recommended for new database keys.
  • Nil / Max — all zeros or all ones, used as sentinels meaning “no value” or “maximum”.

Storing UUIDs efficiently

As text a UUID takes 36 bytes; as binary it takes 16. PostgreSQL has a native uuid type, and MySQL 8 offers UUID_TO_BIN() / BIN_TO_UUID() for BINARY(16) columns. Avoid random v4 primary keys on very large InnoDB tables: their random order fragments the clustered index, whereas v7 values append at the end like an auto-increment.

Frequently Asked Questions

Are these UUIDs really unique?

They are generated with a cryptographically secure random number generator, so collisions are astronomically unlikely. Uniqueness is probabilistic rather than guaranteed, but in practice it is safe to treat v4 and v7 UUIDs as unique.

Should I use UUID v4 or v7?

Use v7 for database primary keys and anything you want sorted by creation time. Use v4 when the ID must reveal nothing, because v7 exposes when it was created to the millisecond.

Is a GUID the same as a UUID?

Yes. GUID is Microsoft’s name for the same 128-bit format. Windows tools often show GUIDs in uppercase and wrapped in braces, like {3F2504E0-4F89-41D3-9A0C-0305E82C3301} — use the uppercase and braces options to match.

Can a UUID be used as a secret token?

A v4 UUID contains 122 random bits, which is enough entropy, but UUIDs are designed as identifiers and often end up in logs and URLs. For API keys and secrets use the Random String Generator or Password Generator.

How do I generate a UUID in code?

In modern browsers and Node.js use crypto.randomUUID(). In PHP, WordPress provides wp_generate_uuid4(). In Python use uuid.uuid4(), and uuid.uuid7() from Python 3.14. PostgreSQL 13+ has gen_random_uuid() and PostgreSQL 18 adds uuidv7().