# How I use ULIDs when sortable IDs help

A beginner-friendly guide to ULIDs, timestamp prefixes, sortable identifiers, and when they are better or worse than UUIDs.

- Date: 2026-09-27
- URL: https://ilham.dev/posts/how-to-use-ulids-when-sortable-ids-help/
- Markdown: https://ilham.dev/posts/how-to-use-ulids-when-sortable-ids-help/index.md
- Tags: ulid, ids, database, tools
- Reading time: 2 min


A ULID is an identifier that includes a timestamp part, so generated IDs sort roughly by creation time.

The [ULID Generator](/tools/ulid-generator/) tool helps with the mechanical part, but I still check the result before using it somewhere real.

## The simple idea

A ULID is an identifier that includes a timestamp part, so generated IDs sort roughly by creation time.

I use the tool to make the transformation visible: input on one side, output on the other, and a quick sanity check before I copy anything.

## Step 1: Generate a single ULID to see the format

Generate a single ULID to see the format.

## Step 2: Generate several and notice the sort order

Generate several and notice the sort order.

## Step 3: Use ULIDs when chronological sorting is helpful

Use ULIDs when chronological sorting is helpful.

## Step 4: Avoid ULIDs when revealing creation time is a problem

Avoid ULIDs when revealing creation time is a problem.

## Step 5: Store them consistently as uppercase strings unless your system chooses otherwise

Store them consistently as uppercase strings unless your system chooses otherwise.

## Step 6: Do not use ULIDs as secrets

Do not use ULIDs as secrets.

## Step 7: Compare with UUIDs before choosing an ID format for a project

Compare with UUIDs before choosing an ID format for a project.

## My checklist

Before I trust the result, I check:

- Generate a single ULID to see the format.
- Generate several and notice the sort order.
- Use ULIDs when chronological sorting is helpful.
- Avoid ULIDs when revealing creation time is a problem.
- Store them consistently as uppercase strings unless your system chooses otherwise.
- Do not use ULIDs as secrets.
- Compare with UUIDs before choosing an ID format for a project.

Small utilities are useful because they remove repetitive work. They are safest when the output is still reviewed.
