uuid.lol

ULID Generator

Press c to copy or r for a new one

Generate in bulk

What is a ULID?

A ULID is 128 bits written as 26 characters of Crockford base32: a 48-bit millisecond timestamp followed by 80 random bits.

Crockford base32 excludes I, L, O and U, so a ULID cannot contain a character that is easy to misread or that accidentally spells something. It is also case-insensitive.

Why use a ULID?

The timestamp comes first, so ULIDs sort lexicographically into creation order. Sorting the text sorts the records.

Being 128 bits, a ULID converts to and from a UUID without loss, which means a database column typed as a UUID can store one.

26 characters against a UUID's 36 makes it noticeably tidier in a URL.

ULID or UUID v7?

They encode nearly the same thing. v7 has the advantage of being a real UUID: it is standardised in RFC 9562, every database and language already has a UUID type for it, and it needs no extra dependency.

ULID's advantage is the shorter, friendlier text form. If you are choosing today and the ID will live in a database column, UUID v7 is the safer pick.

Both share the same caveat: the creation time is public and nearby IDs are partly guessable, so neither should be used as a secret.

Generate one in code

TypeScript

import { ulid } from "ulid";

ulid();

Python

from ulid import ULID  # pip install python-ulid

str(ULID())

Go

import "github.com/oklog/ulid/v2"

ulid.Make().String()

Rust

// cargo add ulid
use ulid::Ulid;

Ulid::new().to_string();