Local-only · Crockford Base32
ULID Generator
Universally Unique Lexicographically Sortable Identifiers — 26 URL-safe Crockford Base32 characters combining a 48-bit millisecond timestamp and 80 bits of Web Crypto randomness.
ULID
Anatomy of a ULID
Your first generated ULID split into timestamp and cryptographic entropy.
The first 10 characters encode the 48-bit Unix millisecond timestamp in Crockford Base32. The trailing 16 characters carry 80 bits of CSPRNG entropy. Crockford's alphabet omits ambiguous characters (I, L, O, U), requires no hyphens, and preserves exact chronological order when sorted as plain ASCII strings.
ULID Timestamp Decoder
Paste any 26-character ULID to extract its exact UTC timestamp and 80-bit random payload.
Use it in code
One block, pick your language — live-synced to your first generated ULID.
// npm install ulid
import { ulid, decodeTime } from 'ulid';
const id = ulid();
// → ''
console.log(new Date(decodeTime(id)).toISOString());# pip install python-ulid from ulid import ULID identifier = ULID() # → print(identifier.datetime.isoformat())
-- Store ULIDs as CHAR(26) (lexically sortable) or 16-byte UUID via pgx_ulid
CREATE TABLE orders (
id CHAR(26) PRIMARY KEY,
customer_id BIGINT NOT NULL
);
INSERT INTO orders (id, customer_id)
VALUES ('', 42);// go get github.com/oklog/ulid/v2
package main
import (
"crypto/rand"
"fmt"
"github.com/oklog/ulid/v2"
)
func main() {
id := ulid.MustNew(ulid.Now(), rand.Reader)
fmt.Println(id.String())
// →
}ULID vs UUID v7 vs UUID v4 vs NanoID
Choose between compact Base32 strings, RFC 9562 binary UUIDs, or short URL tokens.
UUID type without binary mappingUUID columns36 chars with hyphens in text form; 74 random bits vs ULID's 80