{jsonbody.com}

UUID Generator

Generate cryptographically random UUID v4 values, one at a time or up to 1000 in bulk. Choose uppercase, no hyphens or braces, then copy or download. Free.

Generate random UUID v4 values

A UUID is a 128-bit identifier, written as 32 hexadecimal digits in five groups. Version 4 UUIDs are almost entirely random, which means any system can create them independently without asking a central database for the next number. This tool generates one at a time or up to 1000 in bulk using your browser's cryptographic random generator. Each is created on your device.

You can choose uppercase, remove hyphens or add braces, depending on what your system expects. Then copy all the values or download them as a text file.

Anatomy of a UUID v4

In a version 4 UUID, 122 of the 128 bits are random. The remaining six bits mark the format. The first digit of the third group is always 4, and the first digit of the fourth group is 8, 9, a or b.

Format and output variations
xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx

Standard:    3f2b8c1e-9a4d-4e6f-8b21-7c5d9e0a1b2c
Uppercase:   3F2B8C1E-9A4D-4E6F-8B21-7C5D9E0A1B2C
No hyphens:  3f2b8c1e9a4d4e6f8b217c5d9e0a1b2c
Braces:      {3f2b8c1e-9a4d-4e6f-8b21-7c5d9e0a1b2c}

Can two UUIDs ever collide?

In theory they can. In practice, it is so unlikely that you can ignore it. With 122 random bits there are about 5.3 × 10³⁶ possible values. You would need to generate roughly a billion per second for around 86 years to reach a 50 percent chance of even one duplicate. A bad random number generator is a far more likely cause of duplicates than bad luck, which is why this tool uses the browser's crypto API rather than Math.random.

UUIDs as database keys

UUIDs are great when records are created in many places, such as across services, offline clients or merged databases. They also hide how many records you have, unlike an auto-increment ID such as /orders/1042. There are trade-offs, though.

  • They take 16 bytes in binary form and 36 as text, compared with 8 for a BIGINT.
  • Random values scatter inserts across a B-tree index, which can slow large tables. MySQL's clustered primary key is especially affected.
  • UUID v7 begins with a timestamp, so it sorts by creation time and reduces this problem.
  • Store them in a native uuid type where available, as in PostgreSQL, or as BINARY(16) in MySQL.

Frequently Asked Questions

What is the difference between a UUID and a GUID?

They are effectively the same thing. GUID is the name Microsoft uses, and it is often written in uppercase with braces.

Are UUIDs safe to use as secret tokens?

A v4 UUID from a cryptographic generator is hard to guess, but it was not designed as a secret. For session or reset tokens, use a purpose-built random token. Our Random String Generator can create test values.

How do I generate a UUID in code?

JavaScript has crypto.randomUUID(), Python has uuid.uuid4(), and PostgreSQL has gen_random_uuid().

Are generated UUIDs stored?

No. They are created in your browser and are not sent to or saved by this site.