ULID generator
Processed in your browser · nothing is uploaded
Generates ULIDs: 26 characters of Crockford base32, with the first 48 bits being a millisecond timestamp, so a list of them sorts chronologically as plain text.
How to use the ulid generator
That sortability is the entire reason to prefer a ULID over a UUID for a database key. A random v4 UUID as a primary key scatters inserts across a B-tree index, which fragments it and measurably hurts write throughput on a busy table; a ULID inserts at the end, keeping the index compact. It also means you can read the creation time out of the key, and sort by it without a separate column. The alphabet excludes I, L, O and U. The first three because they are confusable with 1 and 0, and U reportedly to avoid accidental obscenities.
Questions
It sorts by time, so inserts land at the end of the index instead of scattering across it. That is a real write-throughput difference on a busy table.
26 characters: 48 bits of timestamp and 80 of randomness, in Crockford base32.
I, L, O and U. The first three to avoid confusion with digits, the last to avoid accidental words.
Yes, the first ten characters are the millisecond timestamp.
80 random bits per millisecond. Collisions within the same millisecond are not something you will observe.