# Nano ID: 8.5 out of 10

A strong pick. 1st of 9 in [ID generators](https://elestia.ai/opensource/ids/index.md).

Nano ID is a tiny, dependency-free, secure generator of short random string IDs that works in browsers, Node.js and React Native. For random IDs in URLs, client state and text keys it is the best pick today. If you need a standard UUID format or keys sorted by time for database indexes, use uuid (v7) or ULID instead.

**Best for:** Projects that need short, secure, URL-safe random IDs in the browser or on the server, with no dependencies.

## Scores

- **Overall: 8.5** (likely 7.5 to 9.3)
  - Claude Opus 5.5 (8.5): It is the default for short, secure random string IDs in JS. It is well maintained, faster than before and very widely used. It falls short of a universal default because uuid v7 or ULID fit time-sorted database keys and standard formats better. The 2026 advisories call for keeping it up to date.
  - GPT-6.2 Sol (8.5): Nano ID is a strong pick for compact random IDs because the typed API is small, the package has no runtime dependencies, and maintenance remains active. Choose uuid for UUID interoperability or UUIDv7 ordering. The range reflects uncertainty about direct adoption of 6.x and how broadly release responsibility is shared.
- **Needed by many: 7.2** (likely 6.0 to 8.3)
  - Claude Opus 5.5 (7.5): Most web apps need unique IDs for records, client state or links. Random short IDs are a large part of that need. Some of it now goes to crypto.randomUUID() or to time-sorted IDs for database keys.
  - GPT-6.2 Sol (6.8): Compact IDs are useful across web front ends, APIs, and distributed back ends. Nano ID serves multiple runtimes without tying projects to a framework. Many projects can use IDs from their database or runtime, and survey data does not measure how many need a compact format.
- **Helps a lot: 8.6** (likely 7.6 to 9.4)
  - Claude Opus 5.5 (8.5): Nano ID does its job very well. It is small and fast, has good types (including opaque types) and lets you set the alphabet and length. It does not make time-sorted or standard-format IDs, and that is a real limit for database keys. Several size-argument edge-case bugs were found and fixed this year.
  - GPT-6.2 Sol (8.7): The one-call default produces 126 random bits in 21 characters, and the typed API has clear examples for custom formats. Version 6.0.2 is fast in Node benchmarks, with results that vary by workload and benchmark harness. The uuid package is a better fit for standard UUIDs and time-ordered UUIDv7.
- **Holds up over time: 8.3** (likely 7.2 to 9.3)
  - Claude Opus 5.5 (8.5): The repo is active: 139 commits and 22 releases in the last year, no open issues, and 160 contributors. Andrey Sitnik leads it, and he also maintains PostCSS, which depends on Nano ID, so the project is tied to core tooling. The main risk is that it rests on one lead maintainer. Its major versions also drop Node.js versions often.
  - GPT-6.2 Sol (8.0): Nano ID had 139 commits and 22 releases in the past year, including fixes on the older 3.x line. The release tags reviewed were signed by the same maintainer, and the full publisher count and funding level are unclear. Recent maintenance is active, though the v6 runtime change adds upgrade work for teams on older Node versions.
- **Used widely: 8.8** (likely 7.7 to 9.6)
  - Claude Opus 5.5 (9.0): About 1.5B downloads in 4 weeks, 5.3x the same weeks a year ago and above the 4.1 median. Much of that comes through PostCSS and other tools that install it. Even so, 1.6M dependent repos is more than uuid's 1.0M, which shows heavy direct use.
  - GPT-6.2 Sol (8.6): Ecosyste.ms found 1.62 million dependent repositories and 7,827 dependent packages, ahead of the peer repository counts in the bundle. Four-week downloads rose 5.3× year over year, above the 4.1× catalog baseline and uuid's 2.3× growth. Repeat installs and transitive use through projects such as PostCSS make it hard to estimate how many teams are choosing Nano ID directly today.
- **Vouched for: 7.7** (likely 6.6 to 8.8)
  - Claude Opus 5.5 (7.5): Major tools such as PostCSS, Vite's toolchain and many frameworks depend on it, so it runs in production at a very large scale. Independent comparison guides recommend it for short URL-safe IDs. There is no survey data specific to ID generators.
  - GPT-6.2 Sol (7.8): Cloudflare's AI Chat package depends on Nano ID, and Redux Toolkit uses an inlined non-secure copy for request IDs. Independent benchmark authors have measured high throughput for compact IDs on their own setups. The visible integrations mostly validate earlier releases or copied code, and direct evidence of satisfaction with 6.x is limited.
- **Safe: 7.4** (likely 6.4 to 8.5)
  - Claude Opus 5.5 (7.0): MIT licence, zero dependencies, and npm provenance with staged publishing. Four advisories came in the last 24 months, including the HIGH CVE-2026-73086, where a huge size value corrupts the random pool. All four were patched, also on the 3.x and 5.x lines, and they need size values controlled by an attacker. The Scorecard is 6.5, with weak code-review and branch-protection checks.
  - GPT-6.2 Sol (7.8): Nano ID has zero runtime dependencies and a permissive MIT license. The three high-severity 2026 advisories cover earlier releases and have fixes on the 3.x and 5.x lines. Version 6.0.2 has a verified Git tag and is built through a staged npm publishing workflow. Weak code-review, branch-protection, and fuzzing scores leave uncertainty about how reliably future bugs will be caught.

## Good

- Zero dependencies and a bundle of about 118 bytes, so it costs almost nothing in front-end builds.
- Uses a secure random source, and the default 21-character ID holds about 126 bits of entropy.
- customAlphabet and customRandom let you choose the length and the character set, for example numeric-only codes.
- Actively maintained: 6.0 is about 4x faster, ships with types, and is published with npm provenance.

## Bad

- IDs are not sorted by time, so as database primary keys they index worse than UUID v7 or ULID.
- The format is not a standard, so Postgres uuid columns and APIs that expect a UUID need the uuid package instead.
- In 2026 several advisories about the size argument (infinite loops, random pool corruption) needed patch upgrades.
- Major versions drop old Node.js lines and APIs: 6.0 removed Node 18 and 20, and 5.0 removed the async API.

## The numbers

- Downloads, 4 weeks: 1.5B
- In a year: ×5.3
- GitHub stars: 27k
- Commits, 12 months: 139
- Last npm release: Oct 2026
- Advisories, 24 months: 4
- Licence: MIT
- GitHub: https://github.com/ai/nanoid
- npm: https://www.npmjs.com/package/nanoid

Scores run from 0 to 10 and are the mean of the scores of AI reviewers (Claude Opus 5.5, GPT-6.2 Sol), made on 22 November 2026 from GitHub, npm, OSV, OpenSSF Scorecard, ecosyste.ms, Hacker News and Bluesky data and a web search. The ecosyste.ms count of repositories that use a project is far too low for projects that grew in the last few years, and some reviews quote it. Overall is the reviewers' own judgement for a new project today, not an average of the parts. An AI wrote them and can be wrong.
