# Nano ID

> Tiny, secure, URL-friendly unique string ID generator for JavaScript

Source: https://talira.ai/catalog/nano-id-7nsftkjs
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library, Command-line tool
- Categories: [libraries / unique ids](https://talira.ai/categories/libraries/unique-ids), [languages / javascript](https://talira.ai/categories/languages/javascript)
- Licence: MIT[^3]
- Pricing: Free and open source[^2]
- Pricing notes: Free and open source (MIT).
- Free tier: yes[^2]
- Backed by: [Andrey Sitnik](https://talira.ai/orgs/andrey-sitnik.md), [Evil Martians](https://talira.ai/orgs/evil-martians.md)

Nano ID generates short, URL-friendly unique IDs in JavaScript using a hardware random generator. Its default IDs are 21 characters from A-Za-z0-9_- with 126 random bits, so collisions are about as unlikely as with UUID v4's 122 bits in 36 characters. It's 117 bytes minified and brotlied with no dependencies, supports custom alphabets and sizes, has a non-secure variant for speed, and runs as a CLI with npx nanoid. It's built by Evil Martians and ported to over 20 other languages.

## Links

- GitHub: https://github.com/ai/nanoid

## Problems it solves

- generate short unique IDs for URLs or database rows in JavaScript
- make random IDs shorter than a UUID that are still safe from collisions
- get a random ID from the terminal without installing anything

## Features

- 21-character URL-safe IDs from a hardware random generator
- 117 bytes minified and brotlied, no dependencies
- custom alphabet and size with customAlphabet
- non-secure variant for speed where randomness quality doesn't matter
- CLI: npx nanoid with --size and --alphabet
- ports in over 20 programming languages

## Limitations

- Version 6 supports Node.js 22, 24 and 26 or newer only.[^1]

## Trust

Overall: 0.65 out of 1.
Signals: maintenance 0.75, adoption 0.89, momentum 0.72, community 0.88, backing 0.30, extensibility 0.00.

- last commit 4 days ago
- 23 commits in the last 90 days
- latest release 6.0.2 55 days ago
- 27.1k GitHub stars
- 161 contributors
- accepts sponsorship (Github, Tidelift)
- backed by Andrey Sitnik and Evil Martians

## Alternatives

- [uuid](https://talira.ai/catalog/uuid-dmqqzhwk.md): Generates RFC 9562 UUIDs in JavaScript and TypeScript

## Sources

[^1]: https://github.com/ai/nanoid/blob/main/package.json (checked 29 Nov 2026)
[^2]: https://github.com/ai/nanoid/blob/main/README.md (checked 29 Nov 2026)
[^3]: https://github.com/ai/nanoid/blob/main/LICENSE (checked 29 Nov 2026)
