UUID Generator

Generate universally unique identifiers (UUID v4) for databases, APIs and systems.

What is a UUID

A UUID (Universally Unique Identifier), also called a GUID, is a 128-bit identifier used to name records in a way that is practically unique, without relying on a central database to avoid collisions. It's widely used as a primary key in distributed databases, session identifiers and API keys.

How it's generated (version 4)

UUID version 4 is generated from random numbers (using the browser's cryptographically secure crypto.getRandomValues API), with only a few fixed bits to identify the version and variant — the probability of collision between two v4 UUIDs is negligible in practice.

Format

A standard UUID has 36 characters, in the format xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx, where x is a random hexadecimal digit, the "4" indicates the version, and y is one of 8, 9, a or b (indicating the variant).

Choosing between v4 and other versions

Version 4 is fully random and great for opaque identifiers, but in database indexes that randomness causes scattered inserts and fragmentation. For that case, version 7 (defined in RFC 9562) puts a timestamp at the start and keeps roughly creation order. A v4 has 2 to the power of 122, about 5.3 x 10 to the power of 36, possible values. Store it in a 16-byte binary column instead of a 36-character string, and compare it case-insensitively, since uppercase and lowercase hex mean the same.

Frequently asked questions

Can the generated UUIDs repeat?

The probability is astronomically low — a v4 UUID has 122 bits of randomness, so collisions are practically impossible in practice.

Does this generator work offline / without sending data to a server?

Yes — the UUIDs are generated entirely in your browser, using the native cryptographic API, with no communication with the server.