UUID and ULID Generator

Make identifiers that will not collide, and read the ones you already have.

Runs entirely in your browser

Loading the tool…

Identifiers, generated here in the page from your browser's cryptographic generator, up to a thousand at a time. Nothing is fetched and nothing is sent: a page that asks a server for a random number is doing something odd, and this does not.

Three kinds, and the choice matters more than it used to. v4 is random throughout and is what most people mean by a UUID. v7 puts the time first, so identifiers made in order sort in order, which keeps a database index appending instead of scattering writes across it. A ULID does the same job in 26 characters with no dashes, written in an alphabet that leaves out I, L, O and U so nothing is misread when a person types it back in.

If you are choosing a primary key for a new table, v7 or ULID is almost always the better answer, and the reason is dull and important: with v4 keys, every insert lands in a random place in the index, and the index stops fitting in memory much sooner than you would like.

The box at the bottom reads identifiers rather than making them. Paste one and it says which version it is, which variant, and, for a v7 or a ULID, the moment it was created. That is often the quickest way to work out when a row was written when nobody thought to add a timestamp column.

How to use it

  1. Choose v4, v7 or ULID, and how many you need.
  2. Generate, then copy them in the format your code wants.
  3. Paste an existing identifier below to see what it is.

Questions

Which one should I use?

v7 for anything stored in a database, because the identifiers sort by creation time and keep the index tidy. ULID for the same reason when you also want something short and easy to read aloud or type. v4 when the identifier must give away nothing at all, including when it was made.

Are these safe to use as secrets?

No. A v4 UUID has 122 random bits and is unguessable in practice, but a v7 and a ULID both start with the time, which anyone can guess. Use them as names for things, not as passwords, session tokens or password reset links.

Will two of these ever be the same?

Not in any practical sense. A v4 has 122 random bits from your operating system's generator; you would have to make billions of them before a collision became worth worrying about. v7 and ULID add the millisecond to that, so two made in the same millisecond still differ in their random part.

Are they generated on a server?

No, and that is worth checking on any site that offers this. The randomness comes from crypto.getRandomValues in your own browser and the formatting runs as WebAssembly in this page. Nothing in the page sends anything anywhere, so it works offline.

What is the nil UUID for?

It is all zeroes and means 'no identifier'. It is useful as a placeholder in tests and in columns that cannot be null, and it is a real, valid UUID rather than a broken one.

Why does the ULID stay in upper case?

Because that is what the specification defines. Crockford base32 is an upper-case alphabet, and lowering it would produce something that is no longer a ULID by the letter of the spec, so the case option applies only to the hex ones.

Can I get the time out of a v4?

No, and that is the point of a v4: there is no time in it. Paste one below and it will say so. A v1, a v7 or a ULID does carry the moment it was made, and the box will show it.

Your data stays on your device

Everything above runs inside your browser as WebAssembly compiled from Rust. Nothing you type is uploaded, logged or stored on a server. You can load this page once, go offline, and it still works.

The page does load ads, which is how it is paid for, and that script is the only thing here that fetches anything. It sees that the page was opened. It does not see what you type or the file you chose, because neither ever leaves this tab.