UUID Generator

Create random unique identifiers.

Output

0 × v4
Count
IDs
0
Length
None
Collision odds
None, there is only one ID

A UUID generator that goes well beyond v4

Make UUIDs in every version, in the format and layout your code needs, then paste any UUID back in to see exactly what it holds. All of it runs in your browser.

  • Every version in one place. Make v1, v3, v4, v5, v6, v7 and v8 UUIDs, plus the Nil and Max values. Each version has a short explanation and a note on what it is best for, so you can pick the right one.
  • Sortable IDs for databases. Version 7 puts a Unix timestamp first, so new IDs sort after older ones and keep database indexes fast. Switch on Keep IDs in order and even a batch made in the same millisecond comes out in strict order.
  • Repeatable name-based IDs. Version 3 and 5 turn a namespace and a name into the same ID every time. Paste a list of names, one per line, and get one ID for each. Use the DNS, URL, OID or X.500 namespace, or your own.
  • Nine output formats. Standard, no hyphens, braces, URN, Base64, URL-safe Base64, Base32, a decimal number or a byte array for C, Go and Rust. Switch between lowercase and uppercase where it applies.
  • Ready to paste into code. Lay the result out one per line, comma separated, as a JSON array, a JavaScript array, a INSERT INTO statement or a CSV column. Copy it all or download it as a file.
  • Up to 10,000 at once. Make a single ID or a whole batch in one go. The tool shows how many were made, how long each is and, for random IDs, how unlikely a repeat is.
  • Inspect any UUID. Paste a UUID and see its version and variant. For v1, v6 and v7 it reads the creation time, shown in UTC and in your time zone, plus the clock sequence, node and counter. It explains why a line is not a valid UUID.
  • Understands every format. The inspector reads UUIDs inside any text, even several on a line, and recognises braces, URNs, no hyphens, Base64, Base32, decimal numbers and byte arrays. Convert, Remove duplicates and Sort rewrite the whole list, and Undo brings it back.
  • Set the time or node yourself. For v1, v6 and v7 enter any date or Unix time to make IDs for a specific moment, which is useful for tests. For v1 and v6 you can also set the node.
  • Private and secure. Random IDs come from your browser's secure random generator, and everything runs on your device. Nothing you make or paste is sent to a server.

How this UUID tool compares with other online generators

Most online generators make a list of v4 IDs and stop. Here is what you usually get from a basic one and what this tool adds.

This UUID tool compared with typical online UUID generators
FeatureTypical online toolThis tool
VersionsUsually v4 only, sometimes v1.v1, v3, v4, v5, v6, v7, v8, Nil and Max, each explained.
Sortable IDsNot offered.v6 and v7 with a counter that keeps a fast batch in order.
Name-basedOne name at a time, if at all.A list of names in, a list of IDs out, with standard or custom namespaces.
FormatsHyphens or no hyphens, upper or lower.Nine formats including URN, Base64, Base32, decimal and byte arrays.
OutputA plain list.JSON, JavaScript, SQL and CSV layouts, with copy and download.
Reading an IDA valid or invalid label.Version, variant, creation time, node and counter, with a clear reason when a line is invalid.
Cleaning a listDone by hand.Convert, remove duplicates and sort in one click, with Undo.
Your dataSome tools call a server.Everything is made in your browser.

How to generate a UUID

  1. Choose a version. v4 is random and fine for most uses, and v7 is best for database keys.
  2. Set how many you want, or for v3 and v5 type the names, one per line.
  3. Pick a format and a layout, such as a JSON array or an SQL insert.
  4. Press Copy all or Download. Press Regenerate for a fresh batch.
  5. To check an existing ID, open Inspect and convert and paste it. You see its version and, for time-based IDs, when it was made.

Uses of UUID

A UUID is useful wherever you need a unique ID without a central counter handing them out. These are the most common uses and the version that suits each.

  • Database primary keys. A UUID can be made by the app before the row exists, so there is no round trip to the database and no clash when several servers write at once. Use v7 so new rows land together in the index.
  • Distributed systems and microservices. Separate services can each create IDs without asking a central counter, and records from different systems can later be merged without renumbering.
  • Public URLs and API resources. A random v4 ID in a link such as /orders/3f2b... cannot be guessed by counting up, unlike /orders/1042. It is not a lock, so still check permissions on every request.
  • Request, trace and correlation IDs. Tag each request or job with a UUID and carry it through logs and services, so one failure can be followed from end to end.
  • File and upload names. Name uploaded files with a UUID to avoid two people uploading photo.jpg and overwriting each other. Use the no hyphens or URL-safe Base64 format for shorter names.
  • Idempotency keys. Send a UUID with a payment or create request so that a retry after a timeout is recognised and not processed twice.
  • Repeatable IDs from names. When the same input must always give the same ID, such as a URL, an email address or an import row, use v5 with a namespace. Running the import again then updates the same records.
  • Test data and fixtures. Make a batch of up to 10,000 IDs and copy it as a JSON array, a JavaScript array or an INSERT INTO statement. For v1, v6 and v7 you can set the timestamp to build data for a specific date.
  • Session and device identifiers. Give a browser, device or anonymous visitor a stable ID. Treat it as a label and not a secret, and use a proper session token for anything that grants access.
  • Debugging and auditing. Paste an ID from a log or database into Inspect to see its version and, for v1, v6 and v7, when it was created. That helps when you need to know how old a record is.

UUID questions

What is a UUID?

A UUID, or universally unique identifier, is a 128-bit value written as 32 hex digits in the pattern 8-4-4-4-12. It lets different systems create IDs without checking with each other and still be practically sure none repeat. A UUID is also called a GUID, especially on Microsoft platforms.

Which UUID version should I use?

Use v4 when you just need a unique random ID. Use v7 for database primary keys, because the timestamp at the front keeps new rows together and sorted. Use v5 when the same input must always give the same ID. Use v1 or v6 only to match an older system.

What is the difference between v4 and v7?

A v4 UUID is almost entirely random, so it carries no information and sorts in no useful order. A v7 UUID starts with the time in milliseconds, so IDs sort by creation time, at the cost of revealing roughly when the ID was made.

Can two UUIDs ever be the same?

In theory yes, in practice no. A v4 UUID has 122 random bits. Even after making 10,000 of them, the chance that any two match is around 1 in 10 to the power of 29, and the tool shows this figure for your batch.

Are the random UUIDs secure?

They come from your browser's cryptographically secure random generator. Even so, a UUID is an identifier and not a secret, so do not use one as the only protection for something private.

What does v3 and v5 mean?

Both build an ID from a namespace UUID and a name using a hash, MD5 for v3 and SHA-1 for v5. The same pair always gives the same result. Choose v5 for new work, since v3 exists mainly for compatibility.

Does a v1 UUID contain my MAC address?

Not from this tool. Old v1 generators used the network card address, but this one uses a random node with the multicast bit set, which marks it as not a real address. You can also type your own node.

Why do v6 and v7 sort in order?

Both put the most significant part of the timestamp first, and UUIDs compare from the left. A v1 UUID stores the low part of the time first, so it does not sort by creation time. v6 reorders those same fields to fix that.

Can I read the time from a UUID?

Yes for v1, v6 and v7. Paste the ID into the inspector and it shows the exact creation time. v4 and name-based IDs hold no time, so there is nothing to read.

What are the Nil and Max UUIDs?

Nil is all zeros, 00000000-0000-0000-0000-000000000000, and means no value. Max is all ones, ffffffff-ffff-ffff-ffff-ffffffffffff, and always sorts after every other UUID, so it is handy as an upper bound.