Starting points for your own code. Run them in the environment shown below.
Node.js 22+ · ES module (.mjs)
Current inputs apply only to fields used by the example. Selected files are not embedded.
Install dependencies
npm install ulid
import { monotonicFactory, decodeTime } from "ulid";
const next = monotonicFactory();
const id = next();
console.log(id);
console.log(new Date(decodeTime(id)).toISOString());
Put it to work
Generate sortable ULIDs and inspect their timestamps.
Details that matter
Format and meaning
ULIDs contain creation time. Do not use them as authentication secrets.
Supported scope and limits
Text 1 MB
Split inputs that exceed the limit. If a format or algorithm is unsupported, choose a tool that matches your requirements instead of silently changing the format.