DevTools Logo

ULID & NanoID Generator

ULID & NanoID Generator

Generate batches of modern unique IDs — sortable ULIDs or URL-safe NanoIDs

Settings

26-character Crockford base32 ID with a 48-bit millisecond timestamp prefix. Lexicographically sortable.

Examples

Generate 10 ULIDs for database rows

import { ulid } from "ulid"

const ids = Array.from({ length: 10 }, () => ulid())
// '01HXYZ4K8P0000000000000000'  ← sortable by creation time

ULIDs are 26 characters, lexicographically sortable, and safe to use as primary keys in databases that support string IDs.

NanoID with custom alphabet for readable tokens

import { customAlphabet } from "nanoid"

const nanoid = customAlphabet('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ', 12)
const token = nanoid() // e.g. 'A3K9FZ2MQ8RT'

A custom alphabet of uppercase letters and digits produces human-readable tokens free of ambiguous characters, perfect for invite codes or short IDs.

Details

ULID (Universally Unique Lexicographically Sortable Identifier) encodes a 48-bit millisecond timestamp plus 80 random bits into 26 Crockford base32 characters. Unlike UUID v4, ULIDs sort chronologically by default, making them ideal for database primary keys. NanoID is a tiny, secure, URL-friendly unique string ID library. Its default 21-character output uses an alphabet of 64 URL-safe characters and provides a collision probability comparable to UUID v4. Both run entirely in your browser — no data leaves your device.