UUID generator · formatULID — a sortable identifier

A ULID is 26 Crockford Base32 characters: the first 10 are time in milliseconds, the other 16 are 80 random bits. Strings sort in creation order like UUID v7, and the alphabet without I, L, O and U survives being read aloud or copied by hand.

01Generator02Anatomy03Comparison04Questions05Related
01

Generator ULID

the format is set — all settings and the checker are in the full generator
Count
Press Generate — identifiers will appear here.
All formats, plus checking and decoding a UUID, are in the full generator →
02

How it is built: ULID

Sample01ARYZ6S41TSV4RRFFQ69G5FAV
01ARYZ6S41
time: 1469918176385 ms — 30 Jul 2016 22:36:16 UTC
TSV4RRFFQ69G5FAV
80 random bits
0–9 A–Z without I L O U
Crockford Base32, case-insensitive

When to use it

  • A key that is handy to sort by its own value — events, logs, queues.
  • Where 36 UUID characters are too long but time inside is needed.
  • If the database stores IDs in a uuid column, v7 is better: a ULID will not fit without conversion.

How it differs from its neighbours

Against UUID v7: they are built almost alike — 48 bits of time first, randomness after — but v7 is standardised in RFC 9562 while ULID is a separate spec. ULID is shorter to write (26 versus 36) and reads without letter confusion. Against NanoID: ULID sorts and reveals the creation time, NanoID does neither. Our generator is monotonic: a batch within one millisecond comes out ascending.

03

Format comparison

FormatLengthRandomnessTime insideSortableStandard
UUID v436122 bitsnonoRFC 9562
UUID v73674 bitsms, 48 bitsyesRFC 9562
UUID v136node and counter100 ns, 60 bitsnoRFC 9562, legacy
Nil UUID36noneno—RFC 9562
NanoID21126 bitsnonoa library, not an RFC
ULID2680 bitsms, 48 bitsyesULID spec, not an RFC
04

Frequently asked questions

A ULID is 26 Crockford Base32 characters, the first ten of which are time in milliseconds, so values sort by creation. UUID v4 is 36 characters in random order; UUID v7 is built like ULID but written in hexadecimal and standardised in RFC 9562. Both formats take 128 bits; they differ in notation and in having a standard.

Updated

«» added to favorites