JustGenerator
Generators 100% Client-Side Privacy

UUID Generator (Version 4)

Create cryptographically random RFC 4122 Version 4 UUIDs (GUIDs) locally using your browser's Web Crypto API, with bulk generation up to 100 IDs at once.

Quick Single UUID v4

Loading...

10 UUIDs · RFC 4122 v4

How to spot a valid RFC 4122 Version 4 UUID

Every Version 4 UUID packs 128 bits into 32 hexadecimal characters formatted as 8-4-4-4-12, such as 9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d. Six of those 128 bits are fixed by RFC 4122: the first character of the third group is always 4 (version 4), and the first character of the fourth group is always 8, 9, a, or b (the RFC 4122 variant). The remaining 122 bits come from random entropy, giving roughly 5.3 × 10³⁶ possible values.

This page calls your browser's native crypto.randomUUID() (backed by your OS CSPRNG, with a crypto.getRandomValues() fallback for older environments). Nothing is requested from a server, so generating a batch of 100 IDs for a database seed script happens in less than a millisecond.

Formatting options for SQL, C#, and compact URLs

Different stacks expect slightly different formatting. PostgreSQL's native uuid type accepts lowercase or uppercase with or without hyphens and normalizes internally, while C# and SQL Server tooling often displays GUIDs in uppercase. Toggle Uppercase or Remove hyphens above the batch box to reformat the current list in place without regenerating new IDs, then grab the whole batch with Copy All or Download .txt.

Where UUID v4 works well (and where it has trade-offs)

Switching from auto-incrementing integers (/orders/1042) to UUID v4 stops outsiders from guessing your order volume or enumerating records by incrementing the URL. It also lets mobile apps, browser clients, and distributed workers assign IDs offline before syncing to a central database.

Two trade-offs are worth keeping in mind before making UUID v4 the clustered primary key on a 50-million-row relational table. First, random v4 inserts land all over a B-tree index instead of appending cleanly at the end, which increases page splits in MySQL InnoDB and PostgreSQL (time-ordered UUID v7 solves this). Second, do not use UUIDs as bearer tokens or password reset secrets: they only carry 122 random bits. Generate 256-bit secrets with our Random Token Generator instead, or use our SHA-256 Hash Generator when you need deterministic content IDs.

Common questions

What is a UUID v4?

A Version 4 UUID (Universally Unique Identifier) is a 128-bit identifier created from random numbers and formatted as 32 hexadecimal characters separated by hyphens in an 8-4-4-4-12 pattern. Six bits mark the version and RFC 4122 variant, while the remaining 122 bits are randomly generated.

Are UUID v4 values guaranteed to be unique?

They are not mathematically guaranteed to never repeat, but the collision probability is astronomically low. With 122 random bits (over 5.3 undecillion possible IDs), you would need to generate around 2.7 quintillion UUIDs to reach even a 50% chance of seeing a single duplicate.

What is the difference between a UUID and a GUID?

In day-to-day software development, UUID and GUID refer to the exact same 128-bit format. UUID (Universally Unique Identifier) is the open IETF standard term, while GUID (Globally Unique Identifier) is Microsoft terminology commonly used in .NET, C#, and SQL Server.

Should I use UUID v4 or UUID v7 for database primary keys?

UUID v4 is ideal for public resource IDs, distributed queues, and privacy because it reveals no timestamp. However, in large relational databases (such as PostgreSQL or MySQL), random v4 primary keys can fragment B-tree indexes. UUID v7 starts with a Unix timestamp so inserts stay roughly sorted while remaining globally unique.

How do I generate a UUID v4 in JavaScript, Python, or SQL?

In modern browsers and Node.js, call crypto.randomUUID(). In Python, run import uuid; str(uuid.uuid4()). In PostgreSQL 13 and newer, use the built-in gen_random_uuid() function.

Can I use a UUID v4 as a password reset token or secret API key?

It is better not to. Even though Version 4 UUIDs use cryptographically strong randomness when generated with crypto.randomUUID(), they are designed as public identifiers rather than secrets. For session tokens or API keys, generate 256-bit random bytes using crypto.getRandomValues() or a dedicated secret manager.