ULID generator

Generate sortable ULIDs one at a time or in bulk, with monotonic ordering, lowercase output or UUID format. Paste ULIDs to read their timestamps and catch typos, duplicates and out-of-order IDs.

  • Generate
  • Runs in your browser. Nothing is uploaded
01KA0000000000000000000000

Space new C copy
Bulk
Inspect ULIDs

Anatomy of a ULID

01KA2Z8Q3R  X5V6T9N4M2JHWB7C
|--------|  |--------------|
timestamp   randomness
48 bits     80 bits
10 chars    16 chars

The first 10 characters are the time in milliseconds since 1970, so any ULID can be turned back into a date. The first character is always 0 to 7, because 48 bits run out in the year 10889.

Checking a list of ULIDs

Paste one or more ULIDs, one per line. Quotes, commas and whitespace from JSON or SQL are ignored. Each line gets its timestamp, and problems are marked in place:

  • Look-alike letters: I or L for 1, O for 0. Fixed in one click.
  • Invalid characters like U, which has no safe replacement.
  • Wrong length, with the missing or extra characters pointed out.
  • A first character above 7, which would overflow the 48-bit timestamp.
  • Lowercase, which is valid but sorts differently from uppercase as plain text.
  • Duplicates and out-of-order IDs, useful when you expect a sorted list.
  • UUIDs, shown in ULID form, so you can match a ULID stored in a UUID column.

ULID vs UUID

ULIDUUID v7UUID v4
Length as text263636
Sortable by timeYesYesNo
Random bits8074122
StandardCommunity specRFC 9562RFC 9562
Native database typeNo (store as text or UUID)YesYes

Generating ULIDs in code

// JavaScript (npm i ulid)
import { ulid, monotonicFactory } from 'ulid';
ulid();                       // 01KA2Z8Q3RX5V6T9N4M2JHWB7C
const next = monotonicFactory();

# Python (pip install python-ulid)
from ulid import ULID
str(ULID())

// Go (github.com/oklog/ulid/v2)
ulid.Make().String()

Prefer the standard? The UUID generator makes time-sortable v7 UUIDs. Working with the timestamps themselves? Use the Unix timestamp converter.

Questions people ask

What is a ULID?
A Universally Unique Lexicographically Sortable Identifier: 128 bits, like a UUID, made of a 48-bit millisecond timestamp and 80 random bits. It’s written as 26 characters of Crockford Base32, such as 01KA2Z8Q3RX5V6T9N4M2JHWB7C, so IDs sort by creation time as plain strings.
ULID or UUID v7?
They’re almost the same idea: a timestamp followed by randomness, sortable by time. UUID v7 is an official standard (RFC 9562) and fits native uuid database columns. ULIDs are shorter as text (26 characters vs 36) and URL-friendly. If your database has a UUID type, v7 is usually the easier choice; you can also store a ULID in a UUID column using the “as UUID” option.
What does monotonic mean?
Normally, two ULIDs made in the same millisecond have random, unordered tails. In monotonic mode, the random part is incremented by one for each ID in the same millisecond instead, so they still sort in the order they were created.
Why don’t ULIDs use I, L, O or U?
Crockford Base32 leaves them out because they’re easily confused with 1 and 0 (and U to avoid accidental rude words). Decoders are meant to read I and L as 1 and O as 0, and the inspector offers that fix when it spots them.
Do ULIDs reveal when they were created?
Yes, to the millisecond. Anyone who sees the ID can read the timestamp, as the inspector does. If creation time is sensitive, use a fully random ID such as UUID v4 instead.
↑↓ move↵ openesc close