UUID Generator

Generate random unique UUIDs (v4) in multiple formats — perfect for IDs, tokens, and identifiers.

GenerateUUIDUnique IDv4

No UUIDs generated

Click Generate to create UUIDs

Pro tip: Generate up to 100 UUIDs at once.

All UUIDs are generated locally — your data never leaves your browser.

A UUID (universally unique identifier, called a GUID in Microsoft tooling) is a 128-bit value written as 32 hex digits in five hyphen-separated groups, such as 3f2b8c1e-9d4a-4c7b-8e21-5a6f0d9b7c34. In a version 4 UUID, 122 of those bits are random and the other 6 mark the version and variant. This tool generates v4 UUIDs, one at a time or up to 100 at once.

Values come from crypto.randomUUID(), the browser's built-in generator backed by a cryptographically secure random source. In older browsers that lack it, the tool falls back to crypto.getRandomValues and sets the version and variant bits itself. Math.random is never used.

Because anyone can create them without coordinating with a central counter, v4 UUIDs suit client-generated primary keys, idempotency keys, correlation IDs in logs and test fixtures. They are not ordered by time, which can fragment B-tree indexes on large, insert-heavy tables. UUID v7 is time-ordered and addresses that, but this tool does not generate it.

A UUID is an identifier rather than a secret, and it tends to end up in URLs, logs and analytics. For API keys or passwords, use the password generator. If you need an ID that is always the same for the same content, a hash of the content is closer to what you want.

  1. One UUID is generated as soon as the page loads. Copy it with the button next to it.
  2. For more, set Quantity (1 to 100) and click Generate. The new batch replaces the current list.
  3. Choose Standard, Uppercase or Lowercase to change how the UUIDs are displayed and copied.
  4. Click Copy All to copy the whole batch, one UUID per line.
  5. Hover over a UUID and click the trash icon to remove it, or click Clear to reset to a single new UUID.

  • RFC 9562 version 4 UUIDs from crypto.randomUUID
  • CSPRNG fallback via crypto.getRandomValues for older browsers
  • Batches of 1 to 100 UUIDs per click
  • Standard, uppercase and lowercase display
  • Per-UUID copy, Copy All (newline-separated) and per-item removal
  • Generated in the browser; nothing is sent to a server

Anatomy of a v4 UUID

3f2b8c1e-9d4a-4c7b-8e21-5a6f0d9b7c34
              ^    ^
              |    variant: 8, 9, a or b
              version: always 4

The first digit of the third group is always 4, and the first digit of the fourth group is 8, 9, a or b. Everything else is random.

Uppercase form

3F2B8C1E-9D4A-4C7B-8E21-5A6F0D9B7C34

The same value. The UUID spec asks for lowercase output and case-insensitive input, but some Windows and .NET tools display GUIDs in uppercase.

Using a UUID as a primary key

CREATE TABLE orders (
  id    uuid PRIMARY KEY,
  total numeric(10,2)
);

INSERT INTO orders (id, total)
VALUES ('3f2b8c1e-9d4a-4c7b-8e21-5a6f0d9b7c34', 42.50);

PostgreSQL accepts the text form and stores it in 16 bytes in a native uuid column.

Generating the same format in code

crypto.randomUUID()
// '3f2b8c1e-9d4a-4c7b-8e21-5a6f0d9b7c34'

Available in modern browsers on HTTPS pages and in Node.js, where it is exposed through the crypto module.

TypeError: crypto.randomUUID is not a function

Your own code runs on a page that is not a secure context (plain http:// on a host other than localhost) or in an old browser or runtime. crypto.randomUUID is only exposed in secure contexts.

Serve the page over HTTPS, or fall back to crypto.getRandomValues as this tool does, or use a maintained library such as uuid.

invalid input syntax for type uuid

PostgreSQL received a value that is not a well-formed UUID, usually because of surrounding whitespace, extra quotes or a partially copied string.

Copy the UUID again with the copy button and trim the value in your code before inserting it.

Duplicate key value on a UUID primary key

Almost always a single UUID reused: generated once outside a loop, hard-coded in a fixture, or resent on a retry without a new ID.

Generate the UUID per record at the point of creation. If a retry should be idempotent, reusing the ID is intentional and the duplicate error is the expected outcome.

Two copies of the same UUID do not compare as equal

One was stored in uppercase and the other in lowercase in a text column, and the comparison is case-sensitive.

Use a native UUID column, or normalise to lowercase before storing and comparing.

Are v4 UUIDs guaranteed to be unique?

Not guaranteed, but collisions are not a practical concern. With 122 random bits, you would need to generate about 2.7 × 10^18 UUIDs for a 50% chance of a single duplicate. Duplicates in real systems nearly always come from reusing a value in code, not from the generator.

What is the difference between a UUID and a GUID?

None in practice. GUID is Microsoft's name for the same 128-bit format. Microsoft tools often show GUIDs in uppercase and sometimes wrap them in braces, like {3F2B8C1E-...}. This tool does not add braces.

Which UUID versions can this tool generate?

Only version 4 (random). Other versions include v1 (timestamp plus node ID), v5 (derived from a namespace and name using SHA-1) and v7 (Unix timestamp followed by random bits, sortable by creation time).

Why do Standard and Lowercase look the same?

crypto.randomUUID already returns lowercase, which is the canonical form, so the two options produce identical output. Uppercase is the only format that changes the text.

How should I store UUIDs in a database?

Prefer a native type: uuid in PostgreSQL, UNIQUEIDENTIFIER in SQL Server, or BINARY(16) in MySQL using UUID_TO_BIN(). These take 16 bytes instead of 36 for a CHAR column and compare faster. If you are writing the INSERT statements by hand, the SQL formatter helps keep them readable.