Skip to main content

ULID Generator

Each ULID is 26 Crockford base32 characters. The first part encodes Unix time in milliseconds. The rest is random. IDs sort by time.

Rated 4.7 out of 5 based on 403 reviews

How to generate ULIDs

  1. Set how many ULIDs to print, from 1 to 1000.
  2. Leave Upper case on for the usual Crockford look, or turn it off for lowercase.
  3. Generate. Each line is 26 characters. Earlier IDs from earlier milliseconds sort first.
  4. Use a UUID v7 when the receiving system requires a UUID, not a ULID string.

ULID

Universally Unique Lexicographically Sortable Identifier

Length26 Crockford base32 characters
Time field48-bit Unix time in milliseconds
Random field80 bits from Web Crypto
AlphabetCrockford base32, no I, L, O, or U
SortLexicographic order matches time order
Not UUID v7Different layout and alphabet than RFC 9562 UUID version 7

26 Crockford base32 characters

A ULID is always 26 characters from Crockford base32: 0123456789ABCDEFGHJKMNPQRSTVWXYZ. The letters I, L, O, and U are omitted so readers mix them up less often. The canonical form is uppercase. This page can print lowercase if you uncheck Upper case. Both forms encode the same bits. Do not mix case in a system that compares strings byte for byte unless you normalize first.

48-bit time plus 80-bit random

The first 10 characters encode 48 bits of Unix time in milliseconds. The last 16 characters encode 80 bits of randomness from Web Crypto. Two ULIDs created in the same millisecond still differ in the random half with very high probability. The time field is wall-clock Date.now() in this tab, not a NTP-certified timestamp.

Sortable by time, not UUID v7

String sort of ULIDs follows creation time. That is handy in logs and in indexes that use the ID as a key. UUID version 7 is also time-ordered, but it is still a UUID: 128 bits, hex, hyphens, version nibble. A ULID will fail a UUID parser. Generate v7 on the UUID page when the API says UUID. Generate ULID here when the API says ULID. For a short non-time ID, use NanoID.

An identifier, not a secret

Anyone who sees a ULID can read an approximate creation millisecond from the prefix. Do not use a ULID as a password. Do not assume hiding a record is enough if the ID leaks the time you created it.

Generated in this browser

No network call mints the ID. Count can be 1000 lines. Clock skew on the device will show up in the time prefix. If the clock jumps backward, later IDs can sort before earlier ones from a previous session. That is a property of using local time, not a bug in Crockford encoding.

ULID questions

Is a ULID the same as UUID v7?
No. Both can sort by time. UUID v7 is a 128-bit UUID in hex. A ULID is 26 Crockford characters with a different layout.
Why 26 characters?
10 characters hold 48 bits of millisecond time. 16 characters hold 80 bits of random. Together they are 26 symbols in base32.
What is Crockford base32?
A 32-symbol alphabet that skips I, L, O, and U. ULID uses that alphabet, not UUID hex.
Do ULIDs sort by time?
Yes, when you compare the 26-character strings. Earlier milliseconds come first.
Can someone read the time from a ULID?
Yes, approximately. The prefix encodes Unix milliseconds. Treat ULIDs as identifiers, not secrets.
Is Math.random used?
No. The 80 random bits come from Web Crypto.