UUID Generator

One input per line. Output is numbered to match the input order.
Pinned tools are listed in your favourites on the home page.Copies a link to this tool that carries your current input, so it opens ready to run.Gives you an iframe snippet for putting this tool on your own site.
Ctrl+Enter Run  · Ctrl+Shift+C Copy  · Esc Clear

Understand UUID Generator

Generates UUID v4 or UUID v7 identifiers, one at a time or up to 100 at once.

How it works

A UUID is 128 bits, six of which are fixed by the version and variant fields, leaving 122 random bits in a v4 — you would need roughly 2.7 quintillion of them before a collision reached even 50% probability. v4 comes straight from crypto.randomUUID, so the randomness is the platform CSPRNG. A v7 replaces the leading 48 bits with the current Unix time in milliseconds and fills the remaining 74 with randomness, which makes v7 values sort into creation order as plain strings.

When to use it

  • Creating a primary key a client can generate before the row is ever sent to the database.
  • Tagging a request or trace so it can be correlated across several services.
  • Naming uploaded files so two users cannot overwrite each other.
  • Filling a test fixture that needs realistic, definitely-distinct identifiers.
  • Choosing v7 for a table where insert order matters to index health.

Watch out for

  • UUID v4 as a primary key fragments B-tree indexes. Every insert lands at a random point in the key space, so the working set is the whole index rather than its tail. v7 and ULID append like an auto-increment and avoid the problem.
  • A UUID is unguessable but it is not authorization. If an object is reachable by anyone who knows its id, then it is reachable by anyone who receives that URL — check permissions as well.
  • UUID v7 publishes its creation time. The timestamp sits in the value in the clear, so anyone holding the id knows to the millisecond when the record was made. Use v4 where that is sensitive.
  • Store it as 16 bytes where the database allows. As char(36) a UUID costs more than double the space and every index comparison walks a string instead of comparing integers.

Not the right tool for: Short codes a person has to read out or type. 36 characters is a lot to transcribe — a NanoID or a random string of the length you need is a better fit.

Frequently Asked Questions

What is the difference between UUID v4 and v7?

UUID v4 is randomly generated with no time component. UUID v7 is time-ordered (lexicographically sortable), making it better for database primary keys as it creates sequential index entries.

How unique is a UUID v4?

UUID v4 has 122 bits of randomness. The probability of a collision when generating 1 billion UUIDs is approximately 1 in 800 million — essentially impossible in practice.

Should I use UUID as a database primary key?

UUID v4 can cause index fragmentation in databases. UUID v7 or ULID are better choices as they are time-ordered and insert at the end of the index.

How to Use UUID Generator

  1. Paste or type your input in the input area above.
  2. The tool processes your input automatically or click Run.
  3. Copy or download the result using the action buttons.
  4. Use Ctrl+Enter to run quickly from the keyboard.