Developer & Tech
ULID Generator
Enter your details
Runs in your browser
How to use it
Using the ulid generator
- 01
Set the count
Up to fifty per run for fixtures or seed data.
- 02
Copy the newline-separated list
They sort correctly as plain strings; no special comparison needed.
- 03
Verify via the timestamp row
The first ULID decodes back to its creation millisecond in UTC.
Good to know
ULID versus UUIDv4
Both give 128-bit uniqueness, but ULIDs embed creation time up front. Database indexes stay append-friendly, logs interleave chronologically under sort, and debugging gains a free “when was this created?”; advantages UUIDv7 pursues with a different layout.
Why Crockford base32
Human transcription drops characters that look alike. Removing I, L, O and U (and accepting lowercase input) makes ULIDs safe to read aloud or retype; a small ergonomic win that compounds across on-call shifts.
How it's calculated
The math behind this calculator
ULID = 10 chars (48-bit ms timestamp) + 16 chars (80-bit randomness), Crockford base32Every identifier packs the current epoch millisecond into its leading ten characters using Crockford base32 (alphabet 0123456789ABCDEFGHJKMNPQRSTVWXYZ; no I, L, O or U, avoiding transcription mistakes), followed by sixteen characters of cryptographically-sourced randomness.
Within the same millisecond, randomness is forced monotonically increasing, so sorting strings sorts them by creation order exactly. The first ULID’s embedded timestamp is decoded back to a human-readable date so you can verify the structure.
Assumptions & limitations
- 48-bit timestamps cover dates until year 10895 CE.
- Monotonicity is enforced within a generation batch, not across processes.
- Charset excludes I/L/O/U per the Crockford base32 convention.
Worked example
Five identifiers come out sharing a timestamp prefix (same generation burst) with distinct random tails; and string order equals creation order.
FAQ
Frequently asked questions
- Are ULIDs URL-safe?
- Yes; the entire alphabet is uppercase alphanumerics with no symbols, so they drop into URLs, filenames and CSVs without escaping.
- How do I extract the timestamp myself?
- Decode the first ten characters as Crockford base32; the resulting integer is epoch milliseconds. This page shows that decoded value for the first ULID automatically.
- What if two services generate ULIDs in the same millisecond?
- Cross-process monotonicity is not guaranteed. Collisions remain astronomically unlikely thanks to 80 random bits, but strict global ordering needs single-writer design.
- Can existing UUID columns migrate to ULIDs?
- Commonly yes: both fit in binary(16) or fixed-width character columns; many stores keep both formats side by side during migration windows.
Keep exploring