ULID (Universally Unique Lexicographically Sortable Identifier) was created to solve the same problem as UUID v7: time-ordered unique identifiers without coordination. The two formats have nearly identical binary layouts but differ in encoding and standardization.

ULID structure

 01ARZ3NDEKTSV4RRFFQ69G5FAV
 |------||----------------|
 10 chars    16 chars
 timestamp   random (80 bits)

Total: 26 Crockford Base32 characters = 128 bits
FieldBitsCharacters
Timestamp4810 (Crockford Base32)
Randomness8016 (Crockford Base32)
Total12826

UUID v7 structure

 018fbe3a-4c5d-7b12-8f3e-1a2b3c4d5e6f
 |---------|    |   |    |------------|
  48-bit ms   ver rand  rand (62 bits)
                    (12b)

Total: 36 chars (32 hex + 4 hyphens) = 128 bits
FieldBits
Timestamp48
Version4
Random A12
Variant2
Random B62
Total random74

See UUID Bit Fields for the full layout.

Feature comparison

PropertyULIDUUID v7
Size (string)26 chars36 chars
Size (binary)16 bytes16 bytes
Timestamp bits4848
Random bits8074
EncodingCrockford Base32Hex with hyphens
StandardCommunity specRFC 9562
DB UUID columnRequires conversionNative
Case-sensitiveNoConventionally lowercase
URL-safeYesYes (with hyphens)
Go built-inNoYes (1.24+)
.NET built-inNoYes (Guid.CreateVersion7, .NET 9+)

ULID to UUID v7 conversion

Both formats are 128-bit, so conversion is lossless at the binary level:

import { ulid, decodeTime } from 'ulid';
import { v7 as uuidv7 } from 'uuid';

// ULID example
const id = ulid();
const ms = decodeTime(id); // extract Unix ms timestamp

// UUID v7 equivalent — same timestamp, different encoding
const id7 = uuidv7({ msecs: ms });

When to use ULID vs UUID v7

Prefer ULID when:

Prefer UUID v7 when:

Further reading

Frequently asked questions

What is a ULID?

A ULID (Universally Unique Lexicographically Sortable Identifier) is a 128-bit identifier combining a 48-bit Unix millisecond timestamp and 80 random bits, encoded as 26 Crockford Base32 characters (e.g. 01ARZ3NDEKTSV4RRFFQ69G5FAV). ULIDs are case-insensitive, URL-safe, and sort lexicographically in chronological order — the same properties as UUID v7. See Sortable ID.

What is the difference between ULID and UUID v7?

ULIDs and UUID v7 have identical bit layouts: 48-bit timestamp + random bits totaling 128 bits. The key differences are encoding (ULID uses 26 Base32 chars; UUID v7 uses 36 hyphenated hex chars) and standardization (UUID v7 is RFC 9562; ULID is a community spec). UUID v7 stores natively in database UUID columns (16 bytes); ULIDs are stored as TEXT (26 bytes) or require binary conversion. UUID v7 has broader native support in PostgreSQL, MySQL 8, and ORMs. See UUID v4 vs v7.

Should I use ULID or UUID v7 for new projects?

For new projects, UUID v7 is generally preferred because it is an IETF standard (RFC 9562), stores in native UUID database columns, is supported by all major ORMs and query builders, and is generated by built-in APIs in Go (1.24+) and .NET 9+. ULID is better if you specifically need the shorter 26-character display format or are adding to an existing ULID-based system. See What is a UUID.