Menu

ULID Generator

Generate ULIDs with customizable formatting.

  
Format:                      
Encoding:   ?    ?    ?   

    

Use these GUIDs at your own risk! No guarantee of their uniqueness or suitability is given or implied.

Your Daily Fortune


ULID Frequently Asked Questions


What is a ULID?

A ULID (Universally Unique Lexicographically Sortable Identifier) is a 128-bit unique identifier that combines a timestamp with random data. It was designed as a modern alternative to UUIDs, offering globally unique identifiers that are also naturally sortable.

Example:

01K1M6JWXFJ4G0AZD2PMQ2R4VH

What does ULID stand for?

ULID stands for Universally Unique Lexicographically Sortable Identifier.

The name highlights its two main features: global uniqueness and lexicographical (alphabetical) sorting by creation time.


How long is a ULID?

A ULID consists of:

  • 128 bits
  • 16 bytes
  • 26 Base32 characters

Unlike UUIDs, ULIDs do not contain hyphens.


Why is a ULID only 26 characters?

ULIDs use Crockford's Base32 encoding rather than hexadecimal.

Because Base32 stores more information per character, a 128-bit identifier requires only 26 characters instead of the 32 hexadecimal digits used by UUIDs.


How is a ULID structured?

A ULID contains two components:

  • 48-bit Unix timestamp (milliseconds)
  • 80 bits of randomness

The timestamp provides chronological ordering, while the random portion ensures uniqueness.


Can ULIDs be sorted?

Yes.

ULIDs are lexicographically sortable, meaning alphabetical sorting also sorts them by creation time.

This makes them especially useful for databases, log files, and distributed systems.


Can I determine when a ULID was created?

Yes.

The first 48 bits store the Unix timestamp in milliseconds. That timestamp can be decoded into a human-readable date and time.


Are ULIDs unique?

Yes.

ULIDs provide statistical uniqueness using 80 random bits. When generated with a cryptographically secure random number generator, collisions are extraordinarily unlikely.


Can two ULIDs be identical?

Yes, but only if both the timestamp and all 80 random bits are identical.

In practice, this is extremely unlikely.


What encoding does a ULID use?

ULIDs use Crockford's Base32 alphabet:

0123456789ABCDEFGHJKMNPQRSTVWXYZ

The letters I, L, O, and U are intentionally omitted to reduce confusion and avoid accidental word formation.


Are ULIDs case-sensitive?

No.

ULIDs are case-insensitive, although uppercase is the canonical representation.

For example:

01K1M6JWXFJ4G0AZD2PMQ2R4VH

and

01k1m6jwxfj4g0azd2pmq2r4vh

represent the same identifier.


Are ULIDs shorter than UUIDs?

Yes.

Identifier Characters
UUID 36
UUID (without hyphens) 32
ULID 26

The shorter length makes ULIDs easier to read, copy, and include in URLs.


Are ULIDs suitable for URLs?

Yes.

ULIDs are an excellent choice for URLs because they:

  • contain only URL-safe characters
  • have no hyphens or special symbols
  • are shorter than UUIDs
  • are easy to copy and paste
  • preserve chronological ordering

For example:

https://example.com/orders/01K1M6JWXFJ4G0AZD2PMQ2R4VH

No URL encoding is required.


Can ULIDs be used in filenames?

Yes.

ULIDs contain only uppercase letters and digits from the Crockford Base32 alphabet, making them safe for filenames on all major operating systems.

Example:

invoice-01K1M6JWXFJ4G0AZD2PMQ2R4VH.pdf

Why do developers use ULIDs?

Developers often choose ULIDs because they provide:

  • chronological ordering
  • globally unique identifiers
  • shorter text representation
  • URL-friendly format
  • filename-safe characters
  • easy readability
  • decentralized generation

Can ULIDs replace UUIDs?

In many applications, yes.

If your software supports ULIDs, they can often replace UUIDs while offering better sorting and a more compact text representation.


Are ULIDs better than UUIDv4?

It depends on your requirements.

ULIDs provide:

  • natural ordering
  • shorter identifiers
  • URL-friendly format
  • improved readability

UUIDv4 provides:

  • completely random identifiers
  • broader ecosystem support
  • official UUID compatibility

How do ULIDs compare to UUIDv7?

Both are time-ordered 128-bit identifiers.

Feature ULID UUIDv7
Size 128 bits 128 bits
Timestamp 48 bits 48 bits
Encoding Base32 Hexadecimal
Text Length 26 characters 36 characters
URL-friendly Excellent Good
Standard Community specification RFC 9562

UUIDv7 follows the official UUID standard, while ULID is a separate specification.


Can ULIDs be generated offline?

Yes.

Generating a ULID requires only:

  • the current system time
  • a random number generator

No internet connection or central authority is required.


Should ULIDs use a cryptographically secure random number generator?

Yes.

A cryptographically secure random number generator (CSPRNG) minimizes collision probability and helps prevent predictable identifiers.


Can ULIDs be used as database primary keys?

Yes.

Because ULIDs are generated in chronological order, they generally produce less index fragmentation than random UUIDv4 values, improving insert performance.


Should ULIDs be stored as text or binary?

Both formats are valid.

Binary storage (16 bytes) generally offers:

  • lower storage requirements
  • smaller indexes
  • improved performance

Text format is easier to debug, log, and exchange through APIs.


Can I decode a ULID?

Yes.

The timestamp portion can be decoded to determine when the ULID was generated.

The random portion contains no additional information.


Do ULIDs contain personal information?

No.

ULIDs contain only:

  • a timestamp
  • random data

They do not include MAC addresses, IP addresses, usernames, or hardware identifiers.


Can ULIDs be guessed?

Not realistically.

Although the timestamp is visible, the remaining 80 random bits make predicting the complete identifier computationally infeasible.

ULIDs should not be used as passwords or authentication tokens.


What programming languages support ULIDs?

ULID libraries are available for nearly every major programming language, including:

  • JavaScript
  • TypeScript
  • Python
  • Java
  • C#
  • Go
  • Rust
  • PHP
  • Ruby
  • Swift
  • Kotlin
  • C++

Most implementations follow the same specification and generate compatible identifiers.


Should I choose ULID or UUID?

Choose ULID if you want:

  • shorter identifiers
  • chronological sorting
  • URL-friendly values
  • filename-safe identifiers
  • easy readability

Choose UUID if you need:

  • official UUID standards compliance
  • maximum compatibility
  • widespread support across databases, APIs, and programming languages

Both provide excellent uniqueness and are suitable for modern distributed applications.


What is the ULID Text Layout?

xxxxxxxx
-
xxxx
-
4 Version
xxx
-
y Variant
xxx
-
xxxxxxxxxxxx
Total: 36 characters
x = Random hexadecimal digit
4 = UUID version (0100)
y = Variant nibble (8, 9, A, or B)

What is the ULID Binary Bit Layout?

32 Random Bits
16 Random Bits
Version
0100b
12 Random Bits
Variant
10b
14 Random Bits
48 Random Bits
Total: 128 bits
Random: 122 bits
Reserved: 6 bits (Version + Variant)
Version:0100b (UUID version 4)
Variant:10b (RFC 9562 / RFC 4122 variant)