UUID v4 generator

Create UUID v4 identifiers using your browser’s cryptographic random generator. Generate and copy up to 100 at once.

Input is processed in your browser and is not sent to the server.

Quick start

  1. Choose a quantity.
  2. Generate the identifiers.
  3. Copy the results.

UUID v4

UUID v4 has fixed version and variant bits with 122 random bits. The tool uses crypto.randomUUID or a crypto.getRandomValues fallback.

Letter case and hyphen removal affect formatting, not the underlying value. Check the format accepted by the destination system.

Collision probability is not zero

Random quality and generation volume affect collision risk. Databases should still enforce uniqueness where the application requires it.

Identifiers and secrets

A UUID identifies an object; it does not grant authorization. Do not use knowledge of an identifier as the only access check. Purpose-built tokens are preferable when designing authentication or recovery flows.

Recognizing a version 4 UUID

A UUID is written as 8-4-4-4-12 hexadecimal digits. The first digit of the third group is the version and the first digit of the fourth group is the variant. In the example below, the 4 of 4c6e is the version and the b of b1f0 is the variant. In a v4 UUID the version digit is always 4 and the variant digit is one of 8, 9, a or b.

RFC 9562 says hexadecimal digits are output in lowercase and are case-insensitive on input. Some tools, such as Windows GUID utilities, show uppercase, so normalize the case before comparing two values.

Example · UUID v4
3f2b8c1e-9a4d-4c6e-b1f0-7d2e5a9c4b81

Using UUIDs as database keys

Version 4 values are fully random, so new rows land at scattered positions in the index. As a table grows, B-tree page splits and poorer cache use can slow inserts. If you need keys that sort in creation order, consider version 7 (RFC 9562), which starts with a millisecond timestamp. This tool generates version 4 only.

Storage format matters too: the hyphenated string is 36 characters, while the binary form is 16 bytes. PostgreSQL has a 16-byte uuid type and gen_random_uuid(), and PostgreSQL 18 adds uuidv7(). In MySQL 8.0, use a BINARY(16) column with UUID_TO_BIN().

Generating UUIDs from the command line

Commands · Windows · Linux · Python
PS> [guid]::NewGuid()
$ uuidgen -r
$ cat /proc/sys/kernel/random/uuid
$ python3 -c "import uuid; print(uuid.uuid4())"

On Linux, /proc/sys/kernel/random/uuid returns a new v4 value every time it is read. uuidgen may create a time-based value when no high-quality random source is available, so add -r when you need a random one.

Frequently asked questions

Are duplicates impossible?
No. The probability is very small under suitable randomness, but it is not mathematically zero.

Official references

Related tools