Skip to content
koducathome

UUID v4 Generator

Generate random version 4 UUIDs (GUIDs) in bulk with your browser's secure random generator — uppercase, no hyphens, braces, JSON, CSV or SQL output.

How to use this tool

Steps for using the UUID Generator.

  1. UUID v4 is selected. A fresh batch is generated as soon as the page loads, using your browser's secure random generator.
  2. Set How many (1–1000) or use the quick buttons, then press Generate for a new batch at any time.
  3. Turn on Uppercase, turn off Hyphens or add Braces to match the format your code or database expects (for example {…} GUIDs on Windows).
  4. Choose Output as — one per line, JSON array, CSV column, SQL VALUES rows or a quoted list — then Copy all or Download.
  5. Paste any UUID into Validate or inspect to check it is well-formed and see its version and variant.

Example

Three UUID v4 values

Settings
UUID v4 · How many: 3 · One per line
Generated (yours will differ — they are random)
1ac5d5f2-7f0a-4ecb-9ffe-b20bb99efac2
b3175f85-8409-4a4c-a146-e13f8d87d426
80fcdb54-820a-4621-b683-7cd8f18ee15a

Common use cases

  • Primary keys or public IDs that should reveal nothing about when a record was created.
  • Idempotency keys and correlation IDs for API requests and log tracing.
  • Unique file names, upload keys and cache-busting tokens.
  • Seeding test fixtures and mock data with realistic IDs.

How a UUID v4 is built

A UUID is 128 bits written as 32 hexadecimal digits in groups of 8-4-4-4-12. In version 4, six of those bits are fixed — the first digit of the third group is always 4 (the version) and the first digit of the fourth group is 8, 9, a or b (the RFC 9562 variant) — and the other 122 bits are random.

This page uses crypto.randomUUID() where the browser provides it and otherwise fills the bytes with crypto.getRandomValues, both cryptographically secure. Nothing is sent to a server: the IDs exist only in your browser until you copy them.

With 122 random bits, duplicates are not a practical concern: you would need around 2.7 × 10^18 UUIDs for a 50% chance of a single collision. That is why v4 values can be created independently on any number of machines without coordination.

Because v4 is fully random, consecutive values are scattered across the whole range. In a B-tree index (most SQL primary keys) that means inserts land on random pages; for very large, insert-heavy tables a time-ordered UUID v7 keeps the index tighter.

Limitations

  • Up to 1000 UUIDs per batch.
  • A UUID v4 is unique, not secret: don't use it as a password or as the only protection for a private link.
  • Random v4 keys fragment database indexes more than time-ordered IDs on very large, insert-heavy tables.

Frequently asked questions

Is a UUID v4 the same as a GUID?

Yes. GUID is Microsoft's name for the same 128-bit format, and most GUIDs generated today are version 4. Windows tools often show them in uppercase inside braces — turn on Uppercase and Braces to match.

Can two UUID v4 values collide?

Only in theory. With 122 random bits you would need about 2.7 × 10^18 values for a 50% chance of one duplicate. In practice collisions come from broken random generators, which is why this page uses the browser's cryptographic one.

How do I tell that a UUID is version 4?

Look at the first digit of the third group: it is 4. The first digit of the fourth group is 8, 9, a or b. Paste the UUID into Validate or inspect to check it.

Should I use v4 or v7 for a database primary key?

v7 is usually the better primary key because it sorts by creation time, which keeps indexes compact. Use v4 when the ID must not reveal when the row was created.