ULID Generator

Generate Universally Unique Lexicographically Sortable Identifiers with high performance

0
ULIDs Generated
0
ULIDs/Second
0
Active Users

Generate ULIDs

Fast, efficient, and sortable identifiers for modern applications

All data stays in your browser. Nothing is sent to a server.

No ULID generated yet

Options

Copied to clipboard!

ULID vs UUID

Why ULID is better than UUID in many situations?

ULID

Recommended

Time Sortable

First 10 bytes are Unix time that sorts naturally

Crockford's Base32

More efficient encoding, case insensitive, no special characters

Monotonicity Option

Can generate monotonically increasing values for the same timestamp

Human Readable

Easier to debug and read in logs and databases

ULID Example:

01ARZ3NDEKTSV4RRFFQ69G5FAV

UUID

Not Time Sortable

Random bytes don't provide any ordering guarantees

Hex Encoding

Less efficient, requires more characters for same information

No Monotonicity

No built-in mechanism for monotonically increasing values

Less Readable

Harder to distinguish and identify in logs and databases

UUID Example:

123e4567-e89b-12d3-a456-426614174000

Performance Comparison

Generation Speed ULID is 1.5x faster
ULID: ~2.5M/sec UUID: ~1.7M/sec
Storage Size ULID is 27% smaller
ULID: 26 chars UUID: 36 chars
Encoding Efficiency ULID is 20% more efficient
ULID: 5 bits/char (Base32) UUID: 4 bits/char (Hex)

Code Examples

Implementation examples in popular programming languages

JavaScript
// Node.js / Browser
// Installation: npm install @ulid/javascript

import { ulid } from '@ulid/javascript';

// Generate a new ULID
const myUlid = ulid(); // "01F8MECHZX3TBDSZ7XR8H8J1R4"

// Create ULID with custom timestamp (milliseconds)
const customTimestamp = 1616239022000;
const ulidWithCustomTime = ulid(customTimestamp);

// Create monotonically increasing ULIDs (for multiple IDs in the same ms)
import { monotonicFactory } from '@ulid/javascript';
const monotonic = monotonicFactory();
const ulid1 = monotonic(); // "01F8MECHZX3TBDSZ7XR8H8J1R4"
const ulid2 = monotonic(); // "01F8MECHZX3TBDSZ7XR8H8J1R5" (incremented)

// Extract timestamp from ULID
const timestamp = ulid.decode(myUlid).time;
console.log(new Date(timestamp).toISOString());

JavaScript: npm install @ulid/javascript

Buy me a coffee