ULID Generator

Published Updated

Generate 1 to 50 ULIDs at a time, each 26 characters: a 48-bit millisecond timestamp, then 80 random bits. ULIDs made in the same millisecond come out in random order, and a batch of 50 was never in order across 20,000 tries.

Reading the 26 characters

The layout follows the ULID specification, and the page's code writes exactly that:

PartCharactersBitsContent
Timestamp1 to 1048Milliseconds since 1970, from Date.now()
Randomness11 to 268010 bytes from crypto.getRandomValues

A 48-bit timestamp lasts until the year 10889; the largest value, 7ZZZZZZZZZ, is the millisecond 2^48 - 1. The alphabet is 0123456789ABCDEFGHJKMNPQRSTVWXYZ, so a ULID is case-insensitive and safe in a URL.

A batch is not sorted

The spec says sort order is not guaranteed within a millisecond, and offers an optional monotonic mode. This tool does not use it; every ULID gets fresh random bits. Simulated with the page's own generator, 20,000 batches per row:

Batch sizeAll in one millisecondNeighbours in orderBatches already sorted
299.8%50.0%9,999 of 20,000
1098.6%49.9%0
5092.5%50.1%0

If you insert a batch into a database and rely on the ID for row order, add a counter column, or use a library with a monotonic option.

What the first characters tell you

The timestamp is written most significant character first, so ULIDs made close together in time share a long prefix. These prefixes come from the page's own encoder for fixed instants (UTC):

Instant (UTC)First 10 characters
1 January 1970, 00:00:00.0000000000000
30 July 2016, 23:54:10.259 (the spec's example)01ARZ3NDEK
1 January 2026, 00:00:00.00001KDVDNA00
7 September 2039, 15:47:35.55101ZZZZZZZZ
7 September 2039, 15:47:35.5520200000000
12 December 3084, 12:41:28.8321000000000
2 August 10889, 05:31:50.655 (the last millisecond)7ZZZZZZZZZ

One step of the second character is 2^40 ms, about 34.8 years, so every ULID from 3 November 2004 to 7 September 2039 starts with 01. One step of the third character is 2^35 ms, about 398 days: ULIDs made from 14 August 2026 to 16 September 2027 all start with 01M. The fourth character moves about every 12.4 days, so the characters that tell two ULIDs of the same day apart are near the end of the timestamp and in the random part.

The page itself, in four browsers

The real tool was run in Google Chrome 156, Chromium 153 (Playwright build, not Google Chrome), Firefox 155 and Playwright's WebKit build (not the Safari app): 200 presses of Generate with the quantity at 50, so 10,000 ULIDs per browser.

CheckChrome 156Chromium 153Firefox 155WebKit build
Batches made inside one millisecond186 of 200181 of 200176 of 200187 of 200
Neighbours already in text order49.9%50.2%49.8%50.1%
Batches fully sorted0000
Malformed ULIDs or duplicates0000
Decoded time outside the press of the button0000

The random part was checked separately in Node 22.23.1 with the same code: 1,000,000 ULIDs had no duplicates, and in each of the 16 random positions every one of the 32 symbols appeared between 30,764 and 31,763 times, against 31,250 expected for an even spread. Because 80 bits are exactly 16 characters of 5 bits, the last character is as random as the others.

Generating ULIDs

  1. Step 1

    Look at the first one

    A ULID is already on screen when the page loads, made at that moment. Copy it with the icon beside it.

  2. Step 2

    Set a quantity

    Type a number from 1 to 50. Anything outside that range is pulled back to the nearest limit.

  3. Step 3

    Generate and copy

    Press Generate ULIDs. Copy All joins the list with line breaks, one ULID per line.

ULID, UUID v4 or UUID v7

  • Length: 26 characters, against 36 for a UUID, as the spec points out.
  • Order: a ULID sorts by time at millisecond level. UUID v4 is all random and does not. UUID version 7 in RFC 9562 also begins with a 48-bit millisecond timestamp.
  • Size: both are 128-bit values, which the spec calls compatible.
  • Other generators: UUID Generator makes v4 values, and NanoID Generator makes short random IDs with no timestamp.

ULID questions

Are the ULIDs in a batch in creation order?

Not as text. Most of a batch is made inside one millisecond, and the 16 random characters decide the order after that. In the test, neighbouring ULIDs were in the right order only half the time.

How do I read the date inside a ULID?

Decode the first 10 characters as a base-32 number, using the Crockford alphabet, to get milliseconds since 1970. The spec's example 01ARZ3NDEKTSV4RRFFQ69G5FAV decodes to 30 July 2016, 23:54:10.259 UTC.

Can two ULIDs collide?

Only if they share a millisecond and draw the same 80 random bits. The spec counts 1.21e+24 possible values per millisecond. The bits come from crypto.getRandomValues, not Math.random.

Why does a ULID never contain I, L, O or U?

Crockford's alphabet leaves them out because they look like 1 and 0, and to avoid spelling words by accident. That leaves 32 symbols, each worth 5 bits.

Does a ULID reveal when it was made?

Yes, to the millisecond, and anyone can decode it. If creation time must stay private, use a random ID such as a UUID v4 or a NanoID.

Does the tool upload anything?

No request carries the ULIDs. Each one is built in the page from Date.now() and crypto.getRandomValues, the tool's code makes no network or storage calls, and generating 10,000 ULIDs in each of the four test browsers made no network request.

Why do all my ULIDs start with the same letters?

The first 10 characters are the time in milliseconds, written with the slowest-changing part first. Every ULID made from 14 August 2026 to 16 September 2027 starts with 01M, and the fourth character changes only about every 12 days, so ULIDs from the same day usually share their first four characters.

Why did the quantity box change the number I typed?

The box is corrected on every keystroke: 51 and 100 became 50, 0, -3 and an empty box became 1, 2.5 became 3 and 2.4 became 2 in all four test browsers. Because an emptied box shows 1 straight away, select the number and type over it instead of deleting it first.

Is the random part spread evenly?

Yes, in a check of 1,000,000 ULIDs from the page's code: each of the 32 symbols turned up in each random position within about 1.6 percent of an even share, and no ULID repeated. The bits come from crypto.getRandomValues, and 80 bits fill the 16 random characters exactly, so no symbol is favoured.

Related Tools