UUID Generator

Create random version 4 or time-ordered version 7 UUIDs in the format you need, and check the version and variant of any UUID or GUID.

Runs entirely in your browser. Nothing you add is sent to us.

Create a free account to use the UUID Generator

Free forever for this tool. Takes a few seconds — then you come straight back here.

  • All 150 free tools, one login
  • Free website audit with fixes
  • Search Console dashboard
  • Free keyword rank tracker

Already have an account? Sign in

UUID Generator — uuid generator

A UUID generator creates universally unique identifiers: 128-bit values such as 3f2b8c1e-9a4d-4e7b-b1c2-5d6e7f8a9b0c that you can use as database keys, file names, order references and API identifiers without asking a central server for the next number. Our free tool makes random version 4 UUIDs and time-ordered version 7 UUIDs as defined in RFC 9562, one at a time or up to 1,000 at once, in upper or lower case, with or without hyphens and braces. It also checks any UUID or GUID you paste and tells you its version, its variant and, for time-based UUIDs, when it was created. Everything runs in your browser using its secure random number generator.

How to use the UUID generator

  1. 1 Choose a versionPick version 4 for a fully random identifier, or version 7 when the IDs will be database keys and you want them to sort in the order they were created.
  2. 2 Set how many you needEnter any number from 1 to 1,000. Bulk lists are handy for seeding test data, preparing import files or pre-allocating IDs.
  3. 3 Pick the formatChoose upper or lower case, keep or remove the hyphens, and add braces if your system expects the Microsoft GUID style {…}. The list updates instantly.
  4. 4 Copy or downloadCopy a single UUID, copy the whole list, or download it as a text file with one UUID per line. Press Regenerate for a fresh set.
  5. 5 Check an existing UUIDPaste any UUID or GUID into the checker to confirm the format is valid and see its version, variant and, for versions 1, 6 and 7, the time embedded in it.

What a UUID is

A UUID, or universally unique identifier, is a 128-bit number written as 32 hexadecimal digits in five groups separated by hyphens, in the pattern 8-4-4-4-12. Microsoft calls the same thing a GUID, a globally unique identifier, and often shows it in upper case inside curly braces. The format is defined by the Internet Engineering Task Force, originally in RFC 4122 and since 2024 in RFC 9562, which replaced it and added versions 6, 7 and 8.

The point of a UUID is that anyone, anywhere, can create one independently and be confident it will not clash with one made by someone else. That removes the need for a central counter. A mobile app can create a record while offline, a web shop can give an order an ID before it reaches the database, and two separate systems can merge their data later without renumbering anything.

Two small fields inside every standard UUID describe how it was made. The version is the first digit of the third group, so a version 4 UUID always has a 4 there and a version 7 UUID has a 7. The variant is held in the first digit of the fourth group, and for standard UUIDs that digit is always 8, 9, a or b. The checker on this page reads both fields for you.

Version 4 or version 7: which should you use?

Version 4 UUIDs are random. Apart from the six bits that mark the version and variant, all 122 remaining bits come from a cryptographically secure random generator. They reveal nothing about when or where they were made, which makes them a good general-purpose choice for public identifiers, invitation links, idempotency keys and anything where predictability would be a problem.

Version 7 UUIDs start with a 48-bit timestamp counting milliseconds since 1 January 1970, followed by random bits. Because the time comes first, version 7 values sort in creation order, both as text and as bytes. This makes a real difference for databases. Most relational databases store primary keys in a B-tree index, and inserting fully random version 4 keys scatters new rows across the whole index, which causes page splits, poorer cache use and larger indexes on busy tables. Time-ordered version 7 keys are appended near the end, much like an auto-incrementing number, while keeping the benefits of a UUID.

The trade-off is privacy. Anyone who sees a version 7 UUID can read the moment it was created to the millisecond. That is harmless for most internal records, but for public-facing IDs where creation time could leak something about your business, such as how many orders you take a day or when an account was opened, version 4 is the safer pick.

  • Use version 4 for public tokens, links, idempotency keys and general unique IDs.
  • Use version 7 for database primary keys, event logs, message queues and anything you want to sort by creation time.
  • Avoid version 1 in new systems: it embeds a time and traditionally a network card address, which can identify the machine that made it.
  • Use versions 3 or 5 only when you need the same UUID every time from the same name, for example a namespace and a URL.

How unique are random UUIDs?

With 122 random bits there are about 5.3 × 10^36 possible version 4 UUIDs. The chance of a clash depends on how many you create. Using the birthday problem, you would need to generate roughly 2.7 × 10^18 version 4 UUIDs before the chance of even one duplicate reached 50 per cent. For any real application, a collision is far less likely than a hardware fault or a bug elsewhere in your code.

That reasoning only holds if the random numbers are good. This tool uses crypto.randomUUID and crypto.getRandomValues, the browser's cryptographically secure generator, never Math.random. For version 7, the timestamp is followed by a 12-bit counter, seeded randomly each millisecond as RFC 9562 allows, and then 62 random bits, so even 1,000 UUIDs made in the same millisecond stay unique and in strict order.

Formats: case, hyphens and braces

RFC 9562 says UUIDs should be written in lower case but compared without regard to case, so 3F2B… and 3f2b… are the same identifier. Many Microsoft tools, including SQL Server and .NET, display GUIDs in upper case, and the registry and COM wrap them in braces. Some systems store UUIDs without hyphens to save four characters, and URNs prefix them with urn:uuid:. The checker accepts all of these forms and shows the canonical lower-case, hyphenated version.

If you store UUIDs in a database, a native UUID column type is usually best: PostgreSQL has uuid, SQL Server has uniqueidentifier, and in MySQL you can use BINARY(16) with the UUID_TO_BIN and BIN_TO_UUID functions. These take 16 bytes rather than 36 characters, which keeps indexes smaller. Be aware that SQL Server sorts uniqueidentifier values in an unusual byte order, so the ordering benefit of version 7 may not apply there in the way you expect.

Reading a UUID with the checker

Paste a UUID into the checker and it first confirms the shape: exactly 32 hex digits, with hyphens either absent or in the 8-4-4-4-12 positions. If something is wrong it tells you what, for example a missing digit, a letter beyond f, or a hyphen in the wrong place, which are common results of copying from PDFs and emails.

For a valid UUID it reports the version and variant. Versions 1 and 6 count time in 100-nanosecond steps from 15 October 1582, the start of the Gregorian calendar, and version 7 counts milliseconds from the Unix epoch; for these the checker decodes the timestamp and shows it in UTC. That can help when debugging, for example to see roughly when a record was created or to confirm a library is really producing version 7 values. The special Nil UUID of all zeros and the Max UUID of all f characters are also recognised.

A valid format does not mean the UUID exists anywhere or was generated properly. A hand-typed value with the right shape will pass, and some older systems produce identifiers that look like UUIDs but have a non-standard variant. The checker flags those so you know they are not RFC 9562 values.

Privacy and using UUIDs safely

The UUIDs on this page are made in your browser and are not sent anywhere or recorded, so nobody else has a copy of the list you generate. Refreshing the page or pressing Regenerate gives you a new set.

Random UUIDs are hard to guess, but they are identifiers, not passwords. Do not rely on an unguessable ID alone to protect private data: a link containing a UUID can be forwarded, logged by proxies or saved in browser history. Always check that the person requesting a record is allowed to see it. If you need a secret token, such as a password reset link, use a purpose-built random token with an expiry time, and treat it as sensitive.

Examples you can copy

Anatomy of a version 7 UUID

017f22e2-79b0-7cc3-98c4-dc0c0c07398f

017f22e2-79b0   48-bit Unix time in milliseconds
7cc3            7 = version, then a 12-bit counter or random bits
98c4            9 = variant (always 8, 9, a or b)
dc0c0c07398f    random

Decoded time: 2022-02-22T19:22:22Z (the RFC 9562 example)

Generating UUIDs in code

JavaScript   crypto.randomUUID()                      // v4
PHP          Str::uuid() / Str::uuid7()  (Laravel)
Python       import uuid; uuid.uuid4()
PostgreSQL   SELECT gen_random_uuid();               -- v4
MySQL        SELECT UUID();                          -- v1

The same UUID in different formats

Canonical   0192b8d6-3c1e-7a4f-9b2d-5e8f1a2b3c4d
Upper case  0192B8D6-3C1E-7A4F-9B2D-5E8F1A2B3C4D
No hyphens  0192b8d63c1e7a4f9b2d5e8f1a2b3c4d
GUID style  {0192B8D6-3C1E-7A4F-9B2D-5E8F1A2B3C4D}
URN         urn:uuid:0192b8d6-3c1e-7a4f-9b2d-5e8f1a2b3c4d

Common mistakes to avoid

Storing UUIDs as long text strings

A 36-character text column wastes space and slows indexes. Use a native UUID type or 16-byte binary column where your database offers one.

Using random v4 keys on very busy tables

Random keys scatter inserts across the index. Version 7 keeps the benefits of UUIDs while inserting in order.

Exposing creation time by accident

Version 7 and version 1 UUIDs reveal when they were made. Use version 4 for public IDs where that matters.

Treating a UUID as a password

An unguessable ID is not access control. Always check permissions before returning the record it points to.

Generating IDs with Math.random

Home-made UUIDs built on non-secure random numbers can repeat. Use crypto.randomUUID or a well-tested library.

Frequently asked questions

Version 4 is fully random. Version 7 starts with a millisecond timestamp, so values sort in creation order, which suits database primary keys. Version 7 reveals when it was made; version 4 does not.

Yes. They are made with your browser's cryptographically secure random generator and follow RFC 9562, the current UUID standard.

Yes. GUID is Microsoft's name for the same 128-bit format. GUIDs are often shown in upper case inside braces, but the value is identical.

In theory yes, in practice no. With properly random version 4 UUIDs you would need to create billions of billions before a single clash became likely.

Any database that stores UUIDs can store version 7 values, because the format is the same 128 bits. Some newer versions and libraries can also generate them directly.

The first digit of the third group records the version. The first digit of the fourth group records the variant, which is 8, 9, a or b for standard UUIDs.

No. Version 4 UUIDs are random and contain no time. Versions 1, 6 and 7 do contain a timestamp, which the checker decodes.

The tool makes up to 1,000 per batch. Press Regenerate or change the count as often as you like for more.

Free website audit

See how your site scores, free

Speed, SEO, DNS, email (SPF/DKIM/DMARC) and security in one scan, with a prioritised fix list.