Ontoom

UUID generator

Generate UUID v4 for IDs, fixtures and tests.

Important: UUIDs are random (v4). No link to external systems.

History

Latest generated values in this browser, grouped by date.

Nothing yet. Click generate to start.

Used

Values copied in this browser, by date.

Nothing used yet. Copy a result to record it.

What a UUID is

A UUID (Universally Unique Identifier), called a GUID in Microsoft ecosystems, is a 128-bit value written as 32 hex digits in five groups: 8-4-4-4-12, for example 3f2b8c1e-9d4a-4c7e-b2a1-5e6f7a8b9c0d. The current spec is RFC 9562 (2024), which replaced RFC 4122.

This page generates version 4 UUIDs, the random kind. Six of the 128 bits are fixed: four mark the version (which is why the third group always starts with 4) and two mark the variant (the fourth group always starts with 8, 9, a or b). The other 122 bits come from your browser's cryptographic random generator through crypto.randomUUID().

How to use it

  1. Pick how many UUIDs you need: 1, 5, 10, 20 or 50.
  2. Click Generate UUID.
  3. Copy a single value, or copy the whole list into a seed file, fixture or spreadsheet.

Will two UUIDs ever collide?

With 122 random bits there are about 5.3 × 10^36 possible values. By the birthday bound, you would need to generate roughly 2.7 × 10^18 UUIDs before the odds of a single collision reach 50%. As long as the generator is cryptographic, you can treat v4 values as unique and insert them without checking the database first.

v4, v7 or an auto-increment ID?

This tool only produces v4. If you need write-heavy primary keys, look at v7 support in your database driver or language runtime.

  • UUID v4 is fully random. Good for public IDs, correlation IDs and anything that must not reveal order or volume.
  • UUID v7 starts with a millisecond timestamp, so new IDs sort in creation order. That keeps B-tree indexes compact when the UUID is a primary key in PostgreSQL or MySQL.
  • An auto-increment integer is smaller and faster, but it leaks how many rows you have and needs coordination across servers.

Generating UUIDs in code

// JavaScript (browsers, Node 19+)
const id = crypto.randomUUID();

# Python
import uuid
id = str(uuid.uuid4())

-- PostgreSQL 13+
SELECT gen_random_uuid();

Practical tips

  • Store UUIDs in a native type (uuid in PostgreSQL, BINARY(16) in MySQL) rather than a 36-character string when you can.
  • Compare case-insensitively. The RFC says to output lowercase but accept both.
  • A UUID is an identifier, not a secret. For API keys or passwords, use the password generator with enough length.

Frequently asked questions

Are UUID and GUID the same thing?
Yes. GUID is Microsoft's name for the same 128-bit format. The only difference is usually presentation, such as uppercase letters or surrounding braces.
Are these UUIDs secure?
They come from crypto.randomUUID(), which uses the browser's cryptographic generator. They are fine as identifiers, but they should not be used as passwords or tokens.
Why does the third block always start with 4?
That digit is the version number, and for v4 it is always 4. The first digit of the fourth block encodes the variant and is always 8, 9, a or b.
Is anything sent to a server?
No. UUIDs are generated in your browser and are not stored by Ontoom.
Can a UUID repeat?
In theory, yes. With a cryptographic generator the probability is so low that real systems treat it as impossible.

Written by Orlando Alves · reviewed on · Editorial policy

See also