Skip to main content
Back to Numbers generators

Numbers

ULID Generator

Used by developers, writers, and creators worldwide.

A ULID generator solves a frustrating gap in standard UUID v4: those identifiers are purely random and cannot be sorted by creation time. ULIDs encode a 48-bit millisecond timestamp in the first 10 characters, followed by 80 bits of cryptographic randomness — giving you a 26-character ID that sorts chronologically out of the box. No separate created_at column needed. The encoding uses Crockford Base32, which strips ambiguous characters like I, L, O, and U, so every ID is safe for URLs, filenames, and copy-paste workflows. A result looks like 01ARZ3NDEKTSV4RRFFQ69G5FAV. Set the count input to however many records you need — 5, 50, or 500 — and the tool generates that many time-stamped, ready-to-paste identifiers in one click.

Loading usage…

Free forever — no account required

How to use

  1. Choose your options above
  2. Click Generate
  3. Copy your result

Detailed instructions

  1. Set the count field to the number of ULIDs you need, from a single ID up to a large batch for seeding.
  2. Click Generate to produce that many ULIDs, each stamped with the current millisecond timestamp.
  3. Copy the generated list and paste directly into your migration file, seed script, or API test payload.

Use Cases

  • Seeding a Postgres staging table with time-ordered primary keys for realistic pagination tests
  • Replacing UUID v4 primary keys in a high-write MySQL schema to reduce B-tree page splits
  • Assigning sortable correlation IDs to distributed microservice events in a Kafka pipeline
  • Generating unique, URL-safe filenames for user-uploaded assets stored in S3
  • Populating Jest or Cypress fixtures so test records sort by insertion order without a timestamp column

Tips

  • Generate IDs in the same batch when seeding related records — they will share a timestamp prefix and sort together predictably.
  • Store ULIDs as CHAR(26) rather than UUID type in Postgres; you keep native string sorting without a custom type.
  • If you need monotonic sort within a single millisecond, use a library like 'ulid' in Node with the monotonic factory — this generator reflects real-world bulk generation, not monotonic sequences.
  • Avoid lowercasing ULIDs before storing them; while the format tolerates it, mixing cases in the same column breaks straightforward string comparison.
  • Use a generated batch of ULIDs as foreign keys across multiple tables in test fixtures — the shared timestamp makes the test data easier to reason about when debugging.

FAQ

how is a ulid different from a uuid v4

UUID v4 is purely random, so rows inserted into a B-tree index scatter unpredictably, causing page splits and slower writes. A ULID's first 10 characters encode the creation timestamp in milliseconds, so newer IDs sort after older ones alphabetically. You get global uniqueness plus chronological order without any extra database column.

are ulids safe to use directly in urls

Yes. Crockford Base32 uses only uppercase letters and digits, deliberately excluding /, +, and = characters that require percent-encoding. You can embed a ULID in a URL path or query string with no transformation, making it a clean alternative to base64-encoded tokens.

should i use ulid or uuid v7 for new projects

UUID v7 also embeds a millisecond timestamp and may integrate more smoothly if your stack already uses the native PostgreSQL UUID type. ULID is the better fit when you want a shorter, hyphen-free, URL-safe format — and when interoperability with libraries like ulid-js, python-ulid, or oklog/ulid in Go matters.