ULID Generator

ULID generator for sortable, unique 26-character IDs, one at a time or up to 500.

Updated

Format

Each ULID starts with the current millisecond timestamp encoded in Crockford Base32, so ULIDs generated later always sort after earlier ones.

About

About the ULID Generator

Generates ULIDs, 26-character IDs that start with the current millisecond timestamp and end with 80 random bits, encoded in Crockford Base32 so they sort by creation time.

A ULID is 10 characters of timestamp followed by 16 random characters. Because the time comes first, ULIDs made in different milliseconds sort in creation order as plain text, which keeps database indexes tidier than random UUID v4 keys. One detail matters for batches: this tool doesn't use the spec's optional monotonic mode. ULIDs created in the same millisecond share a timestamp but have unrelated random parts, so a batch made in one click won't necessarily sort in the order it was listed. The timestamp also reveals when each ID was created, and it comes from your device's clock, so a wrong clock gives wrong timestamps.

Choose what to view about this tool

Guide

Using the ULID Generator

  1. 1

    Step 1

    Enter how many ULIDs you need, from 1 to 500.

  2. 2

    Step 2

    Turn on "Lowercase" if your system stores IDs in lowercase. The spec's standard form is uppercase.

  3. 3

    Step 3

    Click "Generate". Each ULID appears on its own line.

  4. 4

    Step 4

    Click "Copy" to copy the whole list.

  • First 10 characters encode the current Unix time in milliseconds, so IDs from different moments sort chronologically
  • Last 16 characters are random, picked with crypto.getRandomValues
  • Crockford Base32 alphabet (0–9 and A–Z without I, L, O and U), so there are no look-alike characters
  • Always exactly 26 characters, safe to use in URLs and file names
  • Up to 500 ULIDs per click, with optional lowercase output

Database primary keys

Unique keys that are added in roughly time order, instead of scattered all over the index like random UUIDs.

Test fixtures and seed data

Paste a batch of valid ULIDs into test files without writing a script.

Checking an ID format

Generate a few known-good ULIDs to test a parser, validator or database column against.

Log and event IDs

IDs that sort roughly in time order, so related entries stay together.

Examples

ULID Generator examples

3 worked examples

01

The ULID spec's sample

01ARZ3NDEKTSV4RRFFQ69G5FAV is the example in the ULID spec. 01ARZ3NDEK is the timestamp and TSV4RRFFQ69G5FAV is the random part. Your generated values will differ.

02

Lowercase output

With "Lowercase" on, the same ID is written as 01arz3ndektsv4rrffq69g5fav. It's the same value, since ULID decoders ignore case.

03

IDs made a second apart

Generate one ULID, wait a moment and generate another. The second one's first 10 characters are higher, so it always sorts after the first.

FAQ

Frequently asked questions

Quick answers to common questions about the ULID Generator.

What's the difference between a ULID and a UUID?

Both hold 128 bits. A ULID puts a millisecond timestamp first and is written as 26 Base32 characters, so it sorts by creation time as plain text. A random UUID v4 is 36 hex characters with hyphens and has no order. UUID v7 also starts with a timestamp, so it's the closest UUID equivalent.

Will a batch of ULIDs sort in the order they were generated?

Not reliably. A batch is usually created within a single millisecond, so every ID shares the same timestamp and the random part decides the sort order. The ULID spec describes an optional monotonic mode that fixes this, but this tool doesn't use it. IDs created in different milliseconds always sort correctly.

Are ULIDs safe to show publicly?

The random part is unpredictable (80 bits from crypto.getRandomValues), but the first 10 characters reveal exactly when the ID was created. Don't use ULIDs as secret tokens, and avoid them in public URLs if creation times are sensitive.

Why Crockford Base32 instead of hex?

It's shorter (26 characters instead of 32 hex digits) and leaves out I, L, O and U, so IDs are hard to misread or mistype. ULID decoders treat upper and lower case the same.

Can I read the time back from a ULID?

Yes. The first 10 characters are the Unix time in milliseconds in Base32. For example, 01ARZ3NDEK in the spec's sample ULID decodes to a date in 2016. This tool only generates ULIDs and doesn't decode them.

Could two ULIDs ever be the same?

Only if they're created in the same millisecond and also get the same 80 random bits. With about 1.2 × 10²⁴ possible random parts per millisecond, that's not a practical concern.

Still have a question? Contact us

Report a problem

ULID Generator

What went wrong?
    or paste a screenshot