Create v4 UUIDs in bulk
Generate random version 4 UUIDs, also called GUIDs, for database keys, API request IDs, test fixtures and file names. You can make 1 to 50 at a time from your browser's cryptographically secure random source, in standard lowercase form or with uppercase letters and the hyphens removed.
A fresh batch appears when the page opens and again every time you press Generate New UUIDs. Copy All puts the whole list on your clipboard, one ID per line, so it pastes straight into a script, a spreadsheet or an SQL insert.
Where the randomness comes from
Each ID comes from crypto.randomUUID(), the browser's built-in v4 UUID function. On an older browser that lacks it, the tool takes 16 bytes from crypto.getRandomValues() and sets the version and variant bits itself. Both draw on the operating system's secure random generator; Math.random is never used.
A UUID is 128 bits written as 32 hexadecimal digits in groups of 8-4-4-4-12. In a version 4 UUID, six of those bits are fixed: the first digit of the third group is always 4, and the first digit of the fourth group is always 8, 9, a or b. The other 122 bits are random.
Layout: xxxxxxxx-xxxx-4xxx-Nxxx-xxxxxxxxxxxx (N = 8, 9, a or b) Random: 122 bits → 2^122 ≈ 5.32 × 10^36 possible v4 UUIDs Chance of at least one duplicate among n UUIDs (birthday bound): p ≈ 1 − e^(−n(n−1) / (2 × 2^122)) n = 1 million → p ≈ 9.4 × 10^-26 n = 1 billion → p ≈ 9.4 × 10^-20 n = 1 trillion → p ≈ 9.4 × 10^-14 p = 50% → n ≈ 2.71 × 10^18 (about 86 years at a billion per second)
The uppercase and remove-hyphens options only change how the ID is written. The 128-bit value underneath is the same, so a database that stores UUIDs as binary will treat both spellings as one ID.
Assumptions and limits
- Moving the slider or ticking a box doesn't change the list on screen. The new quantity and format apply when you press Generate New UUIDs, which replaces the whole list with fresh IDs.
- Up to 50 UUIDs per click, set with the Quantity slider (5 when the page opens). For thousands, press Generate several times or call crypto.randomUUID() in your own code.
- Only version 4 (random) is produced. Time-ordered v7, name-based v5 and the older MAC-address v1 are not offered.
- v4 UUIDs are random, not sequential, so new rows land all over a B-tree index. On very large tables that can slow inserts compared with an auto-increment or v7 key.
- A UUID is an identifier, not a secret. It is hard to guess, but don't rely on one alone as a password, API key or password-reset token.
Worked examples
Three default v4 UUIDs
With the slider moved to 3, no options ticked and Generate pressed, the output looks like this. Notice the 4 at the start of each third group and the 8, 9, a or b at the start of each fourth group.
171ec981-974d-4beb-a25b-3caba57daaa1 309f9ac1-ac5a-4fe2-ab7a-8ca1b52e89f9 9549776c-e149-4eb4-858d-ff4abd65bb35
Uppercase GUID with no hyphens
Tick both options and press Generate New UUIDs: the new batch comes out as 32-character uppercase strings, the style some Windows tools and older .NET code expect. Written that way, the first ID above would read:
171EC981974D4BEBA25B3CABA57DAAA1
Seeding a test table
Set the slider to 20, generate, press Copy All and paste the column into a spreadsheet next to your test names. Each row now has its own primary key, and the same CSV can be imported into PostgreSQL's uuid column without changes.
How to use the UUID Generator
- Choose how many. Drag the Quantity slider anywhere from 1 to 50 UUIDs.
- Pick the format. Tick Uppercase (A-F) or Remove Hyphens (-) if your system needs that style, then press Generate New UUIDs.
- Copy the list. Press Copy All to copy every UUID, one per line.
Frequently asked questions
What is the difference between a UUID and a GUID?
None in practice. GUID (globally unique identifier) is the name Microsoft uses; UUID (universally unique identifier) is the name in the RFC standard. Both are the same 128-bit format. Windows tools often show GUIDs in uppercase inside braces, which you can get here by ticking Uppercase and adding the braces yourself.
Can two random v4 UUIDs ever be the same?
In theory, yes, but it's so unlikely that systems treat them as unique. Even after generating a billion UUIDs the chance of any duplicate is about 9.4 × 10^-20. You would need around 2.7 × 10^18 of them before the odds reached 50%, which is roughly 86 years of making a billion every second.
Is a UUID v4 cryptographically secure?
Its randomness is. The random bits come from the browser's cryptographically secure generator, so the IDs are unpredictable, which makes them fine as public record IDs that outsiders shouldn't be able to guess in sequence. For secrets such as session tokens, use a purpose-built token of 128 random bits or more and store it hashed.
Should I use UUID v4 or v7 for database primary keys?
Use v4 when you want IDs that reveal nothing, because it's fully random. v7 starts with a timestamp, so new keys sort in creation order and index more efficiently on large tables. This tool makes v4; if insert speed on a huge table matters, consider v7 from your database or language library.
How do I store a UUID in MySQL or PostgreSQL?
PostgreSQL has a native uuid type that stores 16 bytes and accepts the hyphenated text form directly. In MySQL, BINARY(16) is the compact choice, using UUID_TO_BIN() to convert, while CHAR(36) is simpler but takes more than twice the space. The 32-character no-hyphen form fits CHAR(32).
How can I tell which version a UUID is?
Check the first character of the third group. In 6f1c2b7e-3a90-4d2e-9b11-0c7e5a8d4f33 it is 4, so it is a version 4 random UUID. A 7 there means time-ordered v7, and a 1 means the older timestamp-and-MAC v1.
Sources
This tool runs entirely in your browser. What you enter or upload stays on your device and is never sent to our servers.