Skip to the tool
DevToolBench

ULID Generator

Generate sortable ULIDs and decode their timestamp.

0 generated
Reads the timestamp back out

Everything runs in your browser. Nothing you type is sent to a server.

Found a bug in this tool? Report it.

Share this tool

What this ULID generator does

This ULID generator creates Universally Unique Lexicographically Sortable Identifiers in your browser, up to 500 at a time. Each one is a 48-bit millisecond timestamp followed by 80 random bits from crypto.getRandomValues, written as 26 characters of Crockford Base32. Turn on monotonic mode when the order within a batch matters, and switch to lowercase if the system you feed expects it.

Below the generator is a ULID decoder. Paste any ULID and it shows the moment it was created, in UTC and as Unix milliseconds, plus the random part in hexadecimal. It also tells you precisely why an invalid one is invalid: the wrong length, a letter outside the alphabet, or a timestamp too large for 48 bits.

How to use it

  1. Set how many identifiers you need.
  2. Leave monotonic mode on for a strictly increasing list, or turn it off for independent values.
  3. Copy the list or download it as a text file; press Generate for a fresh batch.
  4. To inspect an existing identifier, paste it into the decoder.

ULID vs UUID

The question usually comes down to databases. A random UUID version 4 lands at a random point in a B-tree index, so a table keyed by one fragments as it grows. A ULID starts with the time, so new keys land at the end of the index, the same pattern an auto-incrementing integer produces, without needing a central counter.

UUID version 7 now does the same thing inside the UUID standard, and if your database has a native uuid type it is often the simpler choice. ULID still has two advantages: the text form is 26 characters instead of 36, and it sorts correctly as a plain string, which matters in places like object storage keys, log files and URLs where nothing parses the value.

Monotonic ULIDs, and why a batch shares one millisecond

A computer can make many ULIDs in the same millisecond, and when it does, their timestamps are identical and their order is decided by random bits. The specification's answer is the monotonic ULID: reuse the random part of the previous identifier and add one. The result is still unique, still sortable, and now strictly ordered within the millisecond.

Every batch on this page is stamped with a single millisecond, so you can see the effect directly: with monotonic mode on, the last characters count upwards; with it off, they jump around. The trade-off is that consecutive monotonic values are predictable from one another, which is fine for keys and wrong for anything secret.

Crockford Base32

The alphabet is the digits plus 22 letters, leaving out I, L, O and U so that no character can be mistaken for another when read aloud or copied by hand. Decoding is case-insensitive. The largest valid ULID begins with 7, because 48 bits of time only reach the year 10889, and the decoder rejects anything above that.

Frequently asked questions

What is the difference between a ULID and a UUID?

Both are 128-bit identifiers. A version 4 UUID is entirely random and written as 36 hexadecimal characters with hyphens. A ULID puts a millisecond timestamp in its first 48 bits and is written as 26 characters of Crockford Base32, so it is shorter, case-insensitive and sorts by creation time as plain text.

What does monotonic mode do?

Within a single millisecond, ordinary ULIDs share a timestamp but have unrelated random parts, so their order is arbitrary. In monotonic mode, the first ULID of the millisecond is random and each following one adds 1 to its random part, so a batch generated together comes out strictly increasing.

Can I store a ULID in a UUID column?

Yes. A ULID is 128 bits, the same size as a UUID, so its bytes fit a native uuid or binary(16) column exactly. The database will display it in hexadecimal UUID form, and you convert back to the 26-character form in your application.

Is the timestamp inside a ULID a privacy problem?

It can be. Anyone holding a ULID can read the millisecond it was created, as the decoder on this page shows. That is harmless for an order number, but not for an identifier where creation time is sensitive, and it makes ULIDs a poor choice for anything that has to be unguessable.

Are these ULIDs generated on a server?

No. The timestamp comes from your device's clock and the random part from your browser's crypto.getRandomValues, so nothing is requested from or sent to a server.

Related tools

Updated