ULID Generator

Generate sortable unique IDs (ULID)

Generate one or many ULIDs, choose raw/JSON output, and copy with one click

Last updated: January 22, 2026
Frank Zhao - Creator
CreatorFrank Zhao

ULID Settings

Quantity
1
Format

Generated ULIDs

Adjust settings to generate ULIDs...

Introduction / overview

The ULID Generator creates Universally Unique Lexicographically Sortable Identifiers (ULIDs). Each ULID is a 26-character string that combines a timestamp with randomness, making it convenient for databases, logs, and distributed systems.

What problems does it solve?

  • Create IDs that are usually sortable by creation time (handy for lists and feeds).
  • Generate lots of IDs quickly for fixtures, imports, and batch operations.
  • Reduce the need for database round-trips when you can generate IDs client-side.

Quick note: ULIDs are great as identifiers, but they are not a substitute for secrets. If you need an unguessable secret for URLs or APIs, use our Token Generator.

How to use / quick start

1

Choose how many ULIDs you need

Set the quantity (from 11to100100).

2

Pick an output format

Use Raw when you want newline-separated IDs (great for pasting into logs or CSV cells). Use JSON when you want an array for code and APIs.

3

Refresh to generate a new set

Click Refresh whenever you need a new batch. The IDs are generated locally.

4

Copy and paste where you need them

Click Copy to copy the entire output block. If you only need one ID, set quantity to 11and copy.

How to interpret what you get

A ULID has two main parts: a time component and a random component. In most systems, this means IDs created later tend to sort after older IDs when compared as strings.

ULID length\text{ULID length}==2626==10 (time)+16 (random)10\ (time) + 16\ (random)

Step-by-step examples

Example 1: One ULID for a database record

You are inserting a new row and want a single sortable ID.

  • Set quantity to q=1q = 1
  • Choose Raw format
  • Click Refresh, then Copy

What you copy is a 26-character string. If you also need a standardized UUID, try the UUIDs Generator.

Example 2: Batch IDs for test fixtures (and collision sanity-check)

You need a batch of IDs for unit tests and want a quick sense of how much random space you have.

  • Set quantity to q=50q = 50
  • Choose JSON format so the output is easy to paste into code.
NN==321632^{16}\approx2802^{80}

Here NN is the number of possible random suffixes. For small batches like q=50q = 50, collisions are extremely unlikely.

Real-world examples / use cases

Database primary keys for ordered lists

Background: You store items and frequently query “latest first”.

Inputs: generate q=20q = 20 ULIDs (Raw).

Result: IDs are 26 characters, and later timestamps tend to sort after earlier ones.

How to use it: use the ULID as your primary key or a secondary “public id”. For strict UUID requirements, generate UUIDs instead with UUIDs Generator.

Log correlation across services

Background: You need a request ID that humans can copy from logs.

Inputs: generate q=5q = 5 ULIDs.

Result: Each ULID has a large random space.

Random bits\text{Random bits}==16log23216\cdot\log_2 32==8080

How to use it: add the ULID to log lines, spans, or error reports to quickly correlate events.

Human-friendly public IDs in URLs

Background: You want stable, non-sequential-looking IDs in URLs.

Inputs: generate q=1q = 1 ULID.

Result: A URL-safe string (uppercase alphanumeric) without ambiguous characters.

How to use it: use ULID as a public identifier, but if the URL must be a true secret (password reset link), generate a separate secret using Token Generator.

Test data and mocked APIs

Background: You need predictable-looking IDs for QA without exposing production patterns.

Inputs: generate q=100q = 100 ULIDs (JSON).

Result: A ready-to-paste JSON array of strings.

How to use it: paste into fixtures, seed scripts, or mocked responses.

Quick JSON payloads for demos

Background: You are documenting an API and want sample payloads that look realistic.

Inputs: generate q=10q = 10 ULIDs (JSON).

Result: Copy-paste IDs for examples and docs.

How to use it: pair with Hash Text when you need checksums in the same example.

Common scenarios / when to use

You want “newest first” ordering

ULIDs are convenient when you want identifiers that tend to sort by creation time.

You generate IDs on multiple machines

The random suffix reduces collisions even across distributed systems.

You need a copy-friendly format

ULIDs are short enough to paste and share in logs, tickets, and docs.

You want JSON-friendly output

Use JSON format to paste arrays directly into code and API examples.

You need an ID (not a secret)

Use ULID for identifiers; use Token Generator for secrets that must be unguessable.

You expose IDs publicly

ULIDs avoid sequential integer IDs, making URLs less predictable at a glance.

When ULID may not be the best fit

  • If you need a cryptographic secret (session tokens, reset links), generate a token instead.
  • If you require strict monotonic ordering within the same millisecond, you may need a monotonic ULID implementation.

Tips & best practices

Practical tips

  • Prefer JSON output when you plan to paste into code, config, or API docs.
  • If you expose ULIDs publicly, treat them as identifiers—not secrets.
  • For strict UUID compatibility (systems that expect RFC 4122 strings), use the UUID tool.
  • If you need to share a link that must stay private, generate a dedicated secret with Token Generator.

Calculation method / formulas

Conceptually, a ULID is built by encoding a timestamp and appending a random suffix.

ULID=E32(t)  E32(r)\text{ULID} = E_{32}(t)\ \Vert\ E_{32}(r)

tt is time in milliseconds, stored in 4848 bits.

rr is a random value, typically 8080 bits.

Random bits\text{Random bits}==16log23216\cdot\log_2 32==8080

Collision intuition: if you generate nn ULIDs within the same millisecond, you are effectively drawing nn samples fromN=3216N = 32^{16} possible random suffixes.

pp\approxn(n1)2N\frac{n(n-1)}{2N},,   N=3216\ \ \ N=32^{16}

Related concepts / background

Lexicographically sortable

When two strings are compared character-by-character (lexicographic order), ULIDs often sort by creation time because the timestamp comes first.

This is useful for UI lists, pagination, and database indexes where “newest” and “oldest” are common queries.

ULID vs UUID

UUIDs are widely standardized and commonly used across ecosystems. ULIDs are popular for readability and time-sorting behavior.

If you need specific UUID versions (v1/v4/v5), use our UUIDs Generator.

Frequently asked questions

Are ULIDs unique?

They are designed to be extremely unlikely to collide. The random part has about 8080 bits, i.e. N=280N = 2^{80} possibilities for the random suffix.

Do ULIDs leak time information?

Yes—by design, the prefix encodes time. That’s useful for sorting, but it also means a ULID can reveal approximate creation time.

Should I use ULID for password reset links?

No. Use a cryptographically strong secret instead. Generate it with Token Generator.

Is the output safe to paste into JSON?

Yes. In JSON mode, the output is a JSON array of strings. In raw mode, it’s newline-separated text.

Why do two ULIDs generated “at the same time” not sort perfectly?

If multiple ULIDs share the same millisecond timestamp, the random suffix decides ordering. If you need strict monotonic ordering, use a monotonic ULID generator.

Can I convert a ULID back to a timestamp?

Many ULID libraries can decode the time component. This tool currently focuses on generation.

Limitations / disclaimers

Important notes

  • This tool generates ULIDs in the browser. Results are not stored by the site.
  • ULIDs are identifiers, not secrets. Do not rely on them for access control.
  • Ordering is typically time-based across milliseconds, but within the same millisecond ordering is random.

External references / sources