Skip to content

ULID & NanoID Generator

Generates sortable ULIDs or short NanoIDs with a chosen alphabet and length, and shows collision odds.

Generates ULIDs and NanoIDs — the two short-id formats people reach for when a 36-character UUID is too long for a URL. It also shows the collision arithmetic for whatever length and alphabet you chose, which is the part that decides whether the id is short enough or too short.

🔒 Runs entirely in your browserulidnanoidgeneratorid
Kind

26 characters, sortable, with a millisecond timestamp in the first ten.

How many

0 ids

    How likely is a collision

    Entropy

    80.0 bits

    Ids before a 1% chance

    1.56e11

    At 1,000 per hour

    18 thousand years

    The birthday bound: P ≈ 1 − exp(−n²/2N). The number below is where that reaches one percent.

    Decode a ULID

    ULIDs follow the ULID specification: 48 bits of millisecond timestamp then 80 random bits, in Crockford base32 — which leaves out I, L, O and U so nobody misreads one aloud.

    How to use it

    1. Choose ULID or NanoID

      A ULID is a fixed 26 characters with a millisecond timestamp in the first ten, so it sorts. A NanoID is any length over any alphabet and is pure entropy — nothing about it is ordered.

    2. Set the length and alphabet

      For NanoID, the default is 21 characters over 64 symbols. A shorter id or a smaller alphabet — say a no-lookalike set for something people read aloud — costs entropy, and the panel below shows exactly how much.

    3. Read the collision line

      It gives the number of ids before a one-percent chance of any collision, and how long that is at a thousand a day. Under 64 bits of entropy the page says so, because that is the line between a URL slug and something that must not be guessable.

    4. Decode a ULID if you have one

      Paste it and the panel prints the creation time and the random tail — useful for working out when a record was actually made.

    Common questions

    Is a short id safe as a secret link?

    Only if its entropy says so. A 21-character NanoID has about 126 bits and is fine; a 10-character one has around 60 and is guessable by anyone willing to spend money. The page flags anything under 64 bits for exactly this reason — a short id is a short id, not a secret.

    Why does a custom alphabet still come out uniform?

    Because symbols are drawn with rejection sampling rather than `random % length`. The modulo shortcut biases every alphabet whose length does not divide 256 — the common bug in hand-rolled id generators, and invisible until someone counts.

    What does Monotonic do for a ULID?

    Within a single millisecond, plain ULIDs are in random order relative to each other. Monotonic mode increments the random field instead of redrawing it, so a burst generated in the same millisecond still sorts in the order it was created.

    Why does a ULID use base32 without I, L, O and U?

    That is Crockford’s alphabet: it drops the characters that get confused when a human reads an id aloud or copies it off a screen. The tradeoff is 32 symbols instead of 36, which is why a ULID needs 26 characters where a NanoID needs 21.

    Feed it from

    Next

    These accept what this tool produces, so the result can go straight in.