NID

Nano ID and ULID Generator id

Generate short Nano ID strings or time-sortable ULID identifiers in the browser.

type
length count
OUTPUTidentifiers
0 lines 0 chars
1
Tool Guide

What this tool does

UUID v4 is widely supported but 36 characters long and, being random, cannot be sorted. Nano ID and ULID address those two weaknesses.

Nano ID defaults to 21 characters, shorter than a UUID while offering effectively the same collision resistance. It uses only URL-safe characters, so it drops into an address without encoding, which suits short links and public identifiers. The length is adjustable when you want more or less collision headroom.

ULID is 26 characters: the first 10 encode a millisecond timestamp and the remaining 16 are random. Because of that layout, sorting the strings sorts by creation time. Identifiers accumulate sequentially in a database index, which inserts better than random UUIDs, and the value itself reveals roughly when it was created. Both formats draw from the browser cryptographic random generator.

When to use it

Use it when you need a short identifier for a public URL, when you want sortable primary keys in an insert-heavy table, when generating log or request trace IDs, or when a UUID is simply too long for the screen or a QR code.

Input and output examples

Input Nano ID, length 21, five values
Output Five strings shaped like V1StGXR8_Z5jdHi6B-myT

Only URL-safe characters are used.

Input Three ULIDs
Output Twenty-six character identifiers beginning with the same timestamp prefix

The leading segment is a timestamp, so they sort in creation order.

Notes and limitations

Do not treat unguessability as access control. A design where anyone with the link can view the resource collapses the moment a link leaks, so authorisation must be checked separately. Remember also that a ULID carries its creation time in plain sight, which can expose signup or order timing you would rather keep private. Shortening a Nano ID aggressively raises collision probability sharply, so keep at least the default length wherever volume is high.

Frequently asked questions

Should I use these instead of UUID?

It depends. Stick with UUID when exchanging identifiers with systems that expect the standard format; choose Nano ID or ULID when length or sortability matters more.

Does ULID really sort by time?

The first 10 characters are a millisecond timestamp in Crockford Base32, so string order matches time order. Ordering within the same millisecond is not guaranteed.

Copied