DailyDeskTools home

UUID Generator (v4 and v7)

Generate random v4 or time-ordered v7 UUIDs in bulk, with formatting options.

  • Free forever
  • No signup
  • Runs on your device
UUID GeneratorRuns locally · nothing uploaded
Loading tool…

How to use the UUID Generator

  1. 1Choose version 4 for random IDs or version 7 for IDs that sort by creation time.
  2. 2Set how many you need, up to 1,000.
  3. 3Choose uppercase, hyphens or braces to match your system.
  4. 4Copy one, copy all, or download the list.

What a UUID is

A UUID (universally unique identifier), also called a GUID, is a 128-bit value written as 32 hexadecimal digits, for example 3f2b8c1e-4d5a-4b6c-9e7f-0a1b2c3d4e5f. UUIDs can be created anywhere without a central server and are practically guaranteed never to repeat.

Version 4 or version 7?

  • Version 4 is 122 bits of randomness. It is the most widely supported choice for IDs, tokens and keys.
  • Version 7, defined in RFC 9562, starts with the current time in milliseconds followed by random bits. New IDs sort after older ones, which keeps database indexes efficient when UUIDs are used as primary keys.

How they are generated

Both versions use your browser's cryptographic random number generator. Nothing is sent to a server, and the IDs exist only on your device until you copy them.

Formatting

Hyphens and lowercase are the standard form. Some systems, such as Windows registry entries, expect uppercase with braces. Removing hyphens gives a compact 32-character string.

Version 4 and 7 side by side

Version 4 Version 7
Layout 122 random bits 48-bit Unix time in milliseconds, then random bits
Sorts by creation time No Yes
Reveals when it was made No Yes, to the millisecond
Insert pattern in a database index Scattered across the index Mostly at the end

To reach even a 50% chance of one duplicate, you would have to generate roughly 2.7 quintillion (2.7 × 10^18) version 4 UUIDs. For version 7, uniqueness depends on the 74 non-timestamp bits and on IDs made in the same millisecond. RFC 9562 defines both formats.

Why index order matters

A primary key index keeps its entries in order. Random version 4 values land all over the index, so the database keeps splitting and reshuffling pages. Version 7 values arrive in roughly increasing order and are written near the end, much like an auto-increment number. If the ID will be shown in a URL or an API, remember a version 7 ID tells outsiders when the record was created.

Reading a version 7 timestamp

The first 12 hex digits (ignoring the hyphen) are the creation time in milliseconds. Convert that hex number to decimal and paste it into the Unix timestamp converter to see the date.

Generate UUIDs in code

crypto.randomUUID()          // v4
import uuid
str(uuid.uuid4())
SELECT gen_random_uuid();    -- PostgreSQL 13+
uuidgen

Related tools

A UUID is an identifier, not a secret. For passwords or API keys, use the password generator. To store a UUID compactly, encode its 16 bytes with the Base64 encoder, and to inspect an API payload full of IDs, paste it into the JSON formatter.

Frequently asked questions

Can two UUIDs ever be the same?

In theory yes, but the chance is so small it can be ignored. You would need to generate billions of version 4 UUIDs every second for many years to expect a single collision.

Is a GUID the same as a UUID?

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

Which version should I use for database keys?

Version 7 is usually better for primary keys, because time-ordered values insert efficiently into indexes. Version 4 is fine for everything else.

Should I use UUIDs as passwords or secret tokens?

For secrets, use a dedicated random token or password generator. UUIDs are designed to be unique, not to be kept secret.

How can I tell which version a UUID is?

Look at the first digit of the third group: 4 means version 4 and 7 means version 7. In `3f2b8c1e-4d5a-4b6c-9e7f-0a1b2c3d4e5f` the third group starts with 4.

Can I see when a version 7 UUID was created?

Yes. Its first 48 bits are a Unix timestamp in milliseconds. Version 4 UUIDs carry no time information.

Last updated · By the DailyDeskTools team

Built and written with AI assistance, then tested by hand by our team. How we make our tools