Skip to content

UUID generator: random v4 and time-ordered v7

Make UUIDs for database keys, test data, API requests or file names: random version 4, or version 7, which starts with the time so new IDs sort after older ones. Generate one or up to 10,000 at a time, choose the format your code expects, and copy or download the list. Paste existing UUIDs to check them and read their version, variant and, for time-based versions, when they were created.

Quick answer

Choose version 4 or 7, type how many you need and press Generate new. Copy the list or download it as text, CSV, JSON or a quoted SQL list. To check a UUID, paste it into the validator below.

Based on RFC 9562: Universally Unique IDentifiers (UUIDs), IETF, May 2024 · Page updated 23 October 2026

Editor: Abuzar, founder of NeedMyToolsHow we check facts

122 random bits from your browser’s secure random generator. The usual choice when order does not matter.

…

Validate and decode UUIDs

UUIDs are made in your browser with crypto.getRandomValues. They are not sent, stored or logged anywhere.

How to use the UUID Generator (v4, v7)

  1. Choose version 4 for random IDs or version 7 for IDs that sort by creation time, and type how many you need.
  2. Pick the format options your system expects, such as uppercase or no hyphens, and press Generate new for a fresh batch.
  3. Copy the list, or choose one per line, CSV, JSON or SQL and download it. Paste any UUIDs into the validator to check them.

What a UUID is

A UUID (universally unique identifier) is a 128-bit value written as 32 hexadecimal digits in five groups, 8-4-4-4-12, for example f81d4fae-7dec-11d0-a765-00a0c91e6bf6. Anyone can create one without asking a central registry, and the design makes it practically certain that two systems will never make the same value. The current definition is RFC 9562, published by the IETF in May 2024, which replaced the older RFC 4122 and added versions 6, 7 and 8. The first digit of the third group is the version, and the first digit of the fourth group shows the variant: 8, 9, a or b for the standard layout. RFC 9562 notes that UUIDs are also known as GUIDs, the name used in Microsoft software.

Version 4 or version 7

A version 4 UUID is 122 random bits plus the fixed version and variant bits. It reveals nothing about when or where it was made, which makes it a good default for public IDs, tokens in links and file names. A version 7 UUID starts with the Unix time in milliseconds in its first 48 bits and fills the rest with random bits, so values made later sort after values made earlier. That suits database primary keys: new rows are added at the end of the index instead of at random places in it, which keeps inserts fast on large tables. RFC 9562 recommends version 7 over the older time-based versions 1 and 6. The trade-off is that anyone holding a v7 UUID can read when it was created, to the millisecond, so prefer v4 where that time should stay private.

How this generator makes UUIDs

Random bits come from crypto.getRandomValues, the cryptographically secure generator built into your browser, which is the kind of source RFC 9562 asks for; version 4 uses the browser’s crypto.randomUUID when it is available. For version 7, a batch is often made within one millisecond, so the 12 bits after the timestamp are used as a counter that starts at a random value and goes up by one for each new UUID, one of the methods RFC 9562 describes for keeping IDs in order. If the counter fills up, the next UUID takes the following millisecond, as the standard allows. The result is that a batch of 10,000 v7 UUIDs is already in creation order when sorted as text. Nothing is sent to a server, and no list is kept after you close the page.

Formats for code, databases and spreadsheets

The usual form uses lowercase letters and hyphens, and RFC 9562 allows upper, lower or mixed case. Some systems want uppercase, others store 32 digits without hyphens, Windows and .NET often write a GUID inside braces, and the urn:uuid: prefix turns a UUID into a URN. Choose these options before you copy. For larger batches, the download can be one UUID per line, a CSV file with a uuid header for Excel or Google Sheets, a JSON array for fixtures and mock APIs, or a list of quoted values separated by commas that you can paste into an SQL IN (…) clause or an INSERT statement. If you need random strings rather than UUIDs, use the password generator, and for checksums use the hash generator.

Validating and decoding a UUID

Paste one or more UUIDs, one per line, into the validator. It accepts upper or lower case, with or without hyphens, in braces or with the urn:uuid: prefix, and for each line it says whether the value is valid, which version and variant it has, and whether it is the special Nil UUID (all zeros) or Max UUID (all f). For versions 1, 6 and 7 it reads the timestamp inside and shows when the UUID was created, in UTC. A version 4 UUID has no time inside, so none is shown. Common reasons for an invalid value are a missing or extra digit, the letter o typed for a zero, or extra characters copied with it.

Frequently asked questions

What is the difference between UUID v4 and v7?

Version 4 is fully random apart from a few fixed bits. Version 7 begins with the creation time in milliseconds and is random after that, so v7 values sort in the order they were made.

Are IDs from this UUID generator safe to use in production?

Yes. They follow RFC 9562 and use your browser’s cryptographically secure random generator, so the chance of two being the same is negligible. Nothing is stored, so each batch exists only on your device.

Is a GUID the same as a UUID?

Yes. GUID is the name used in Microsoft software for the same 128-bit identifier. A GUID is often written in uppercase inside braces, which the format options here can produce.

Which UUID version is best for a database primary key?

Version 7 is usually the better choice, because new values sort after old ones and keep index inserts fast. Use version 4 where the creation time must not be visible in the ID.

How can I see when a UUID v7 was created?

Paste it into the validator on this page. It reads the first 48 bits, which hold the Unix time in milliseconds, and shows the creation date and time in UTC.