UUID Generator

Generate one or many random version 4 UUIDs, ready to copy.

What is a UUID?

A UUID (universally unique identifier), called a GUID in Microsoft environments, is a 128-bit value used to identify something without a central authority handing out IDs. It is written as 32 hexadecimal digits in five groups, for example 3f2b8c1e-7a4d-4f0b-9c6e-2d1a5b8e7f30. UUIDs are used as database keys, API request IDs, file names, session tokens and message IDs in distributed systems.

Version 4 (random) UUIDs

This tool generates version 4 UUIDs, as defined in RFC 9562 (formerly RFC 4122). 122 of the 128 bits are random. The remaining six bits mark the version (the "4" at the start of the third group) and the variant (the first digit of the fourth group is 8, 9, a or b).

The random bits come from your browser's cryptographically secure random number generator (crypto.randomUUID or crypto.getRandomValues), not Math.random. UUIDs are generated on your device and never sent anywhere.

Can two UUIDs ever be the same?

In theory yes, in practice no. With 2122 possible values (about 5.3 × 1036), you would need to generate around a billion UUIDs every second for roughly 85 years to reach a 50% chance of a single duplicate. For almost every application, v4 UUIDs can be treated as unique.

UUID versions compared

VersionBased onNotes
v1Timestamp + MAC addressSortable by time, but can reveal the machine
v4RandomMost widely used; nothing can be inferred from it
v5SHA-1 hash of a name + namespaceSame input always gives the same UUID
v7Unix timestamp + randomTime-ordered, so better for database index performance

Generating UUIDs in code

  • JavaScript: crypto.randomUUID()
  • Python: import uuid; str(uuid.uuid4())
  • PHP: Ramsey\Uuid\Uuid::uuid4() or Str::uuid() in Laravel
  • C#: Guid.NewGuid()
  • PostgreSQL: gen_random_uuid()
  • Command line: uuidgen (macOS/Linux)

Frequently asked questions

Is a GUID the same as a UUID?

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

Are these UUIDs secure and random?

Yes. They use your browser's cryptographically secure random generator, and are created locally on your device.

Can I use a UUID as a database primary key?

Yes, and it is common. For very large tables, time-ordered UUIDs (v7) usually perform better in indexes than random v4 UUIDs.

Are UUIDs case-sensitive?

No. The hexadecimal digits are case-insensitive. Lowercase is the standard output, but uppercase represents the same UUID.

Last updated December 2, 2026.