# ai/nanoid

A tiny (118 bytes), secure, URL-friendly, unique string ID generator for JavaScript

Repository: https://github.com/ai/nanoid
Canonical: https://ross.abutalabs.com/products/nanoid
Homepage: https://zelark.github.io/nano-id-cc/
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2026-08-10T20:13:57+00:00

## Health v2 (maintenance only)
Score: 97/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 97, release rhythm 96, longevity 100
- inputs: {"age_days": 3315, "days_push": 23, "days_rel": 26, "gap_med": 1.5, "n_releases_24m": 31}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 26945, forks 871 (observed 2026-08-28T04:11:47.228509+00:00)

## What it is
Nano ID is a tiny (118 bytes), dependency-free JavaScript library for generating secure, URL-friendly unique string IDs using a hardware random generator. It packs a similar number of random bits to UUID v4 into just 21 characters using a larger alphabet, and is faster than crypto.randomUUID().

## Use cases
- generate unique ids for database records
- uuid alternative for javascript
- generate short url-friendly identifiers
- generate random ids in react components
- secure random string generator for node
- generate ids for pouchdb or couchdb documents

## When to choose
- you need short, URL-safe unique IDs smaller than UUIDs
- bundle size matters and you want a zero-dependency library
- you need faster ID generation than crypto.randomUUID or uuid v4
- you want customizable alphabet or ID length

## When to avoid
- you need sequential or sortable IDs like ULID or snowflake IDs
- you need standardized UUID format for interoperability
- you need cryptographically verifiable or non-random IDs

## Facets
- artifact type: library
- maturity: stable
- function: data-generation, cryptography
- domain: developer-tools, web-development
- platform: browser, bun, cross-platform
- tags: id-generator, uuid-alternative, unique-ids, random-string, tiny-library, zero-dependency, algorithms, nodejs, deno

## Member repositories
- ai/nanoid (main) score 97

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:11:47.228509+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T16:54:36.931079+00:00, confidence not recorded.
  - readme: https://github.com/ai/nanoid (fetched 2026-08-28T04:11:47.228509+00:00, sha aa374476690b)
  - homepage: https://zelark.github.io/nano-id-cc/ (fetched 2026-08-29T07:52:15.301653+00:00, sha 666380d3ee17)
  - registry_npm: https://registry.npmjs.org/nanoid (fetched 2026-08-29T07:52:15.311378+00:00, sha 7702cc450165)
- Data as of 2026-08-30T08:39:29.467469+00:00.
