Random for Developers

ULID / Nano ID Generator

Generate a real, spec-compliant ULID or Nano ID — two modern identifier formats increasingly used in place of UUIDs, each built exactly to its published specification.

Cryptographically secure Instant, in your browser Free, no sign-up

Generate

Your result will appear here

How the ULID / Nano ID Generator works

ULIDs (Universally Unique Lexicographically Sortable Identifiers) encode a 48-bit millisecond timestamp in their first 10 characters and 80 bits of randomness in the remaining 16, both encoded in Crockford's Base32 alphabet (which excludes the letters I, L, O, and U to avoid visual confusion with digits) — this is why ULIDs generated later always sort after earlier ones as plain strings, unlike random UUIDs.

Nano IDs are simpler: a fixed-length string drawn from a 64-character URL-safe alphabet (A-Z, a-z, 0-9, underscore, and hyphen). At the default 21 characters, a Nano ID has a comparable collision probability to a standard UUID v4, while being noticeably shorter and safe to use directly in URLs without encoding.

How to use it

1
Choose ULID or Nano IDULID for sortable, timestamp-embedded identifiers; Nano ID for a compact, URL-safe random string.
2
Set length (Nano ID only)Default is 21 characters, matching the Nano ID library's own default.
3
GenerateXrandom builds each ID exactly to its published specification, not just a random-looking approximation.
📖 Guide: A Developer's Guide to Safe Test Data
Advertisement

Frequently asked questions

Why would I use a ULID instead of a UUID?

ULIDs sort naturally in the same order they were created, which UUIDs (except newer time-ordered variants) don't — useful for database primary keys where insert-order sorting improves index performance.

Is a 21-character Nano ID as collision-resistant as a UUID?

Yes, roughly — the Nano ID project's own collision calculations show the default settings need about 149 years of generating 1,000 IDs per second before there's a 1% chance of a collision, comparable to UUID v4.

Are these real, usable IDs?

Yes — unlike some of Xrandom's identity-adjacent tools, both formats are simply general-purpose unique identifiers with no real-world sensitivity, so these are genuinely usable in real applications, not just for testing.