Skip to content
Toolora

UUID Generator

Create cryptographically random identifiers — UUID v4, sortable ULIDs, or compact Nano IDs — one at a time or hundreds at once.

Developer Runs in your browser Works offline
Loading tool…

How it works

UUID v4 is 122 random bits in a fixed layout. The randomness comes from your browser's cryptographic generator, not Math.random, so the values are suitable for identifiers that must not be guessable.

ULID and Nano ID solve different problems. A ULID starts with a millisecond timestamp, so ids sort chronologically and database indexes stay compact — random UUIDs scatter writes across an index and fragment it. A Nano ID is simply shorter for the same collision resistance, with no dashes to escape in a URL.

The formula

UUID v4

122 random bits, with version 4 and the variant bits fixed

ULID

48-bit timestamp + 80 random bits, Crockford base32

Collision odds

≈ 50% after 2.71 × 10¹⁸ UUIDs — effectively never in practice

Worked examples

ScenarioWorkingResult
UUID v48-4-4-4-12 hexf47ac10b-58cc-4372-a567-0e02b2c3d479
ULIDTimestamp firstSorts by creation time
Nano ID21 URL-safe charactersShorter, no dashes

When you'd use it

  • Seeding test data with realistic identifiers
  • Creating a primary key before a record is saved
  • Generating correlation ids for tracing requests
  • Filling a config that needs a unique instance id

Common questions

Are these safe to use as database keys?

Yes, though UUID v4's randomness scatters inserts across the index, which hurts write performance at scale. If that matters, use a ULID — the timestamp prefix keeps new rows adjacent.

Could two of these ever collide?

In practice, no. You would need to generate billions per second for decades before a collision became likely. That holds only because the randomness is cryptographic, which it is here.

Are the generated ids sent anywhere?

No. They are created in your browser and never transmitted, so they are safe to use as secrets or keys.