01What is ULID Generator?
A random UUID v4 makes a fine unique key, but it scatters new rows all over a B-tree index and tells you nothing about when a record was born. A ULID fixes both. It is a 26-character ID that sorts by creation time and still carries plenty of randomness. The format comes from the ULID specification published on GitHub (ulid/spec). Every ID is 128 bits. The first 48 bits are the Unix time in milliseconds, and the last 80 bits are random. Both parts are written in Crockford's Base32, which uses the digits plus 22 letters and skips I, L, O and U so people don't confuse them with 1, 0 or each other. Here is what the generator does under the hood. It reads Date.now() and encodes it into 10 characters. For the random half it fills 16 bytes from crypto.getRandomValues and keeps the low 5 bits of each, giving 16 Base32 characters. If a second ID lands in the same millisecond, which happens all the time in a batch, it follows the spec's monotonic rule. The previous random part is incremented by one instead of drawn fresh. In one of our test runs, two IDs in the same millisecond ended in ...BT8YW and ...BT8YX. That keeps a batch in strict sort order with no duplicates. You can ask for 1 to 50 IDs at once. The list shows the time prefix in a different colour from the random tail, so the structure is easy to see. The Decode ULID box works the other way. Paste an ID and it turns the first 10 characters back into a millisecond count and an ISO 8601 date. Lowercase is fine. It refuses anything that is not exactly 26 characters, uses a letter outside the alphabet, or starts above 7. That last rule exists because a leading 8 or higher would need more than 48 bits of time. The canonical example from the spec, 01ARZ3NDEKTSV4RRFFQ69G5FAV, decodes to 2016-07-30T23:54:10.259Z. A few limits to keep in mind. Monotonic ordering only holds inside the tab that made the IDs. Two servers generating in the same millisecond will interleave at random. Decoding only reads the time prefix, so it cannot tell whether the random part was really random. The clock is your computer's clock, so a wrong system time gives a wrong prefix. IDs are made on your device with the browser's crypto API and are not sent to us.
Backend and database developers who want unique IDs that sort by creation time and can be traced back to a timestamp. The tool runs entirely in your browser, so your data never leaves your device.
02How to use ULID Generator
- Type a number from 1 to 50 in the Count field
- Click Generate to create that many ULIDs, oldest first
- Click Copy to copy the whole list, one ID per line
- Paste any ULID into the Decode ULID field to read its Date and Timestamp (ms)
- Use the reset button to clear the list and set Count back to 5
03Worked examples
- Input:
01ARZ3NDEKTSV4RRFFQ69G5FAV (Decode ULID) - Result:
Date: 2016-07-30T23:54:10.259Z Timestamp (ms): 1469922850259 - The sample ID from the ULID spec. Only the first 10 characters, 01ARZ3NDEK, carry the time.
- Input:
01arz3ndektsv4rrffq69g5fav (Decode ULID) - Result:
Date: 2016-07-30T23:54:10.259Z Timestamp (ms): 1469922850259 - Lowercase input decodes to the same moment.
- Input:
01ARZ3NDEKTSV4RRFFQ69G5FAU (Decode ULID) - Result:
Invalid ULID: must be 26 Crockford Base32 characters (no I, L, O or U) starting with 0-7 - The trailing U is not in the Crockford alphabet.
- Input:
81ARZ3NDEKTSV4RRFFQ69G5FAV (Decode ULID) - Result:
Invalid ULID: must be 26 Crockford Base32 characters (no I, L, O or U) starting with 0-7 - A first character above 7 would overflow the 48-bit timestamp.
- Input:
7ZZZZZZZZZZZZZZZZZZZZZZZZZ (Decode ULID) - Result:
Date: +010889-08-02T05:31:50.655Z Timestamp (ms): 281474976710655 - The largest valid ULID. The time field runs out in the year 10889.
- Input:
Count 3, Generate (one test run) - Result:
01M89XHVZTB36S0R5TKVC9S293 01M89XHVZXF7JYBQNFNPCBT8YW 01M89XHVZXF7JYBQNFNPCBT8YX - Your IDs will differ. The last two share a millisecond, so the third is the second plus one.
04Common use cases
- Picking sortable primary keys for a Postgres, MySQL or DynamoDB table so new rows append near the end of the index
- Tagging events or queue messages so a plain string sort puts them in creation order
- Decoding a ULID from a bug report to find out exactly when that record was created
- Seeding test fixtures with a batch of IDs that are guaranteed to sort in the order they were generated
- Checking whether an unknown 26-character ID is a valid ULID before writing a parser for it
- Comparing the ULID layout with UUID v7 before you settle on an ID format for a new service
05Tips
- Anyone can decode the creation time from a ULID. If signup times or order times are sensitive, keep ULIDs out of public URLs.
- Store ULIDs as 16 bytes, for example in a Postgres uuid column or a BINARY(16) column, rather than as 26-character text. The byte order still sorts by time.
- If Decode shows a date in the far future, the ID probably came from a system that used microseconds or a custom epoch. It is not a standard ULID.
- Monotonic order is per generator. For strict global order across many machines you still need a single sequence or a logical clock.
- UUID v7 (RFC 9562) uses the same time-first idea in a standard UUID shape, which can suit databases with a native UUID type.
06Related concepts
ULID, Crockford Base32, UUID v7, sortable identifiers, monotonic IDs.
Frequently Asked Questions
What is ULID Generator?
ULID Generator is a free, browser-based developer tool on AIDToolStack. Generate lexicographically sortable unique IDs It requires no installation or sign-up and works entirely in your browser.
Is ULID Generator free to use?
Yes. No sign-up, no fees and no usage cap.
Does ULID Generator store my data?
No. It runs in your browser; nothing is uploaded.