ULID generator — sortable 26-character IDs, plus a timestamp reader

Generate up to 1,000 ULIDs that sort in the order they were created, or switch to Read the timestamp and paste a ULID to see the date and time inside it.

Live demo · real result from this tool
Mode

Press Generate to create a result.

Processed on your device — nothing is uploaded.

How to use the ULID generator

  1. Leave Mode on Generate.
  2. Set How many ULIDs (up to 1,000).
  3. Keep Monotonic (same-millisecond IDs keep their order) ticked unless you want fully random tails, and tick Lowercase if your system stores IDs in lower case.
  4. Press Generate and copy the list.
  5. To read a date, switch Mode to Read the timestamp, paste the ULID and read Created (UTC) and Unix milliseconds.

What it does and when to use it

ULIDs (Universally Unique Lexicographically Sortable Identifiers) are popular as database keys, event IDs and log IDs. Because the time comes first, new rows land at the end of an index, which keeps inserts fast, and a plain text sort puts records in creation order. They are also URL-safe and avoid letters that are easy to misread.

The reader is useful when debugging: paste an ID from a log or a URL and you know when the record was made, without a database query. For the standard UUID layout with a timestamp, see version 7 in the UUID generator. For MongoDB’s own 12-byte IDs, use the ObjectId generator. For short random IDs without a timestamp, try the Nano ID generator.

How it works

A ULID has two parts, both in Crockford Base32 (0–9 and A–Z without I, L, O and U):

  • Timestamp: 10 characters for the milliseconds since 1 January 1970 UTC. This is 48 bits, enough until the year 10889.
  • Randomness: 16 characters, or 80 bits, from crypto.getRandomValues.

In monotonic mode, the tool increments the 80-bit tail by one for each further ID in the batch. To decode, it reads the first 10 characters as a base-32 number of milliseconds. The first character can only be 0 to 7, because a larger value would not fit in 48 bits.

Worked examples

  • The specification’s example. Reading 01ARZ3NDEKTSV4RRFFQ69G5FAV gives Created (UTC): 2016-07-30T23:54:10.259Z and Unix milliseconds: 1469922850259.
  • A monotonic batch of three. One run gave 01M4BPDFRWSRP9JG8TM2K25GPN, …GPP and …GPQ: the same timestamp, with the last character counting up. Note that Crockford Base32 skips O, so P follows N.
  • An impossible ULID. 81ARZ3NDEKTSV4RRFFQ69G5FAV is refused with “The first character of a valid ULID is 0–7 (48-bit timestamp).”

Limits and tips

  • The time comes from your device clock. If the clock is wrong, so are the ULIDs.
  • All IDs in a batch share one millisecond, so the batch says nothing about real spacing between events.
  • Mixed upper and lower case sort differently in many databases. Pick one case and keep it.

Frequently asked questions

How is a ULID different from a UUID?
Both hold 128 bits. A ULID puts a 48-bit millisecond timestamp first and writes everything in 26 Crockford Base32 characters, so ULIDs sort by time as plain text and are shorter than the 36-character UUID form. A version 4 UUID is fully random and does not sort.
What does Monotonic do?
All IDs in one batch are made in the same millisecond. With Monotonic ticked, the first ID gets a random tail and each next ID adds one to it, so the list keeps its order when sorted. Unticked, every tail is random and IDs from the same millisecond sort in a random order.
Does a ULID reveal anything?
Yes, the moment it was created, to the millisecond. Anyone can read it with this tool. Do not use ULIDs where creation time is private, and do not use them as secret tokens. Monotonic IDs from one batch differ only in their last characters, so the next one is easy to guess.
Why does decoding accept I, L and O?
Crockford Base32 leaves out I, L, O and U, and asks readers to treat I and L as 1 and O as 0 when someone types them by mistake. The decoder does the same.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close