Nano ID Generator

Generate URL-safe, short, unique IDs in bulk right in your browser. Choose the character set (default, alphanumeric, lowercase, uppercase, digits, or hex) and length freely — ideal when you need something shorter than a UUID.

ID Format Comparison

Format Length Alphabet size Sortable by creation order Description
Nano ID 21 chars by default (1-64 configurable) 64 chars No (fully random) A short random ID made only of URL-safe characters. Alphabet and length are freely configurable.
UUID v4 36 chars (including 4 hyphens) 16 chars (hex) No (fully random) A 128-bit identifier standardized in RFC 9562. The hyphen-separated hex notation is the standard form.
ULID 26 chars 32 chars (Base32) Yes (leading 10 chars are a timestamp) Starts with a millisecond-precision timestamp, so IDs can be sorted lexicographically by creation order.

What Nano ID is

Nano ID is a scheme for generating short random identifiers made up only of URL-safe characters. By default it combines 21 characters drawn from an alphabet of 64 (A-Za-z0-9_-), which keeps it shorter than a UUID while retaining ample randomness for practical use. This tool lets you set the alphabet (default, alphanumeric, lowercase, uppercase, digits or hexadecimal), the length and the number to generate, and create identifiers in bulk.

Generation is done entirely inside your browser using the cryptographically secure random numbers of the Web Crypto API, so nothing is ever sent to the toolbase.cc servers. There is no need to put any secret into a form, and you can copy the identifiers straight out for use as URL slugs, test data, file names and the like.

How to use Nano ID

  1. Choose the alphabet Pick the alphabet that suits your purpose from default (the 64 URL-safe characters), alphanumeric, lowercase only, uppercase only, digits only and hexadecimal.
  2. Set the length Give the number of characters in the identifiers. The shorter you make them, the higher the collision probability, so keep the balance for your purpose in mind.
  3. Give how many to generate Enter the number of identifiers you want at once. When you need several — creating test data in bulk, for instance — you can specify them all here.
  4. Press the generate button Press generate and identifiers matching your settings are created inside your browser at once and listed.
  5. Copy them Individual identifiers have their own copy button, and when you want the lot, copy all takes them together.

Tips for getting more out of it

  • Nano ID is generated with cryptographically secure randomness from the Web Crypto API and processed entirely in your browser — nothing is sent to toolbase.cc servers.
  • The default 64-character alphabet (A-Za-z0-9_-) contains no symbols or spaces, so it's safe to use directly in URL paths or file names.
  • Restricting the alphabet to digits-only or hex can match ID formats used by existing systems (e.g. order numbers that are digits only).
  • Shorter IDs have a higher collision probability. Systems issuing many IDs should stick close to the default 21 characters, while small test datasets may be fine with 8-10.
  • Increase the count and use "Copy all" to quickly generate seed or test data in bulk.

When Nano ID comes in useful

Generating URL slugs

As the unique identifier in the path of a shortened URL or a share link, a URL-safe string with no awkward symbols can be used exactly as it is.

Loading test and dummy data

As primary keys or identifiers for the sample records you load into a database during development, you can generate as many as you need in one go.

Issuing session and request identifiers

As the temporary identifier used for tracing logs or distinguishing API requests, it gives you a short and manageable string.

Numbering file names to avoid collisions

It is handy when you want to attach a random identifier to the stored name of an uploaded file and prevent same-name files from overwriting each other.

Issuing simple API keys and reference codes

Not for production credentials, but easy to reach for when numbering the short reference codes used by internal tools and test environments.

Terms used here

Nano ID
A scheme for generating short random identifiers composed only of URL-safe characters. By default it secures high randomness with 21 characters from an alphabet of 64.
UUID
A 128-bit identifier standardised in an RFC. The 36-character hexadecimal notation separated by hyphens is widely used as its standard form.
ULID
A 26-character identifier carrying a millisecond timestamp at the front. Unlike Nano ID and UUID, it can be sorted as a string into generation order.
Web Crypto API
The API for cryptographic work that browsers provide as standard. It can generate hard-to-predict random numbers, which is what the safety of the identifiers rests on.
Cryptographically secure random numbers
Random numbers designed so that the next value cannot be predicted statistically. They lower the risk of an identifier being guessed or impersonated.
Collision probability
The probability that two different generations happen to produce the same identifier. The more characters and the larger the alphabet, the lower it becomes.
Birthday problem
The phenomenon whereby the more people there are in a group, the more likely two share a birthday. It is used in the approximation for estimating identifier collision probability.

FAQ

If you want a short ID you can drop directly into a URL or file name, Nano ID is a good fit. If you need a format standardized by an RFC, or interoperability with other systems, UUID (especially v4) is the safer default.

With the default 21 characters and 64-symbol alphabet, you get about 126 bits of randomness, which is negligible in practice. Using the birthday-problem approximation, roughly 1.09×10¹⁹ IDs would need to be generated before the collision probability reaches 50%.

Yes, but like UUID v4 it is fully random, so B-Tree index insertion is less efficient than with AUTO_INCREMENT. If you need IDs sortable by insertion order, consider a format with a leading timestamp such as ULID instead.

Yes. At the same length, a smaller alphabet (fewer distinct characters) means less randomness and a higher collision probability. To match the security of the 64-character alphabet using digits only (10 characters), you would need a longer ID.
Tool-kun

Side Note — Why Nano ID Can Be Shorter Than a UUID

Nano ID is a JavaScript ID-generation library released in 2017 by Andrey Sitnik, the developer of PostCSS. Despite being dependency-free and tiny (only a few hundred bytes of code), its use of cryptographically secure randomness earned it recognition, and it now sees tens of millions of weekly npm downloads.

How short an ID can be comes down to how many distinct characters its alphabet has. A UUID uses only hexadecimal digits (16 symbols) to encode 128 bits, requiring 36 characters. Nano ID uses 64 symbols, so it can pack a comparable amount of randomness (126 bits by default) into just 21 characters. The reason is that each character carries more information (log₂64 = 6 bits versus log₂16 = 4 bits for hex).

The default settings (21 characters, 64-symbol alphabet) provide about 126 bits of randomness — roughly on par with UUID v4's 122 bits. Using the birthday-problem approximation, you would need to generate about 1.09×10¹⁹ IDs before the collision probability reaches 50%, so in practice there is little to worry about.