---
id: "nanoid"
kind: "datatype"
status: "draft"
is_pii: false
categories: ["identifiers"]
langs: ["common"]
quality: 73
url: "http://registry.apicrafter.io/datatype/nanoid"
---

# Nano ID (`nanoid`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

Random identifier of the Nano ID library. By default it is 21 characters of the URL-safe alphabet A-Z, a-z, 0-9, underscore and hyphen, which gives a collision probability similar to UUIDv4. Applications can choose another length or alphabet; the regexp covers only the default.

- Personal data (PII): no
- Categories: Universal unique identifiers (identifiers)
- Countries: global
- Languages: Common to most languages (common)
- Classification: identifier

## Detection

Regular expression (Python `re`):

```
^[A-Za-z0-9_-]{21}$
```

## Examples

- `V1StGXR8_Z5jdHi6B-myT` — Example of the Nano ID README
- `IRFa-VaY2b` (invalid example) — Nano ID with a custom size of 10, not covered
- `V1StGXR8_Z5jdHi6B+myT` (invalid example) — The plus sign is not in the default alphabet

## Translations

- ru: Идентификатор Nano ID

## Sources

- doc: <https://github.com/ai/nanoid>

## Quality

Score 73/100. Missing: second example, mapping (Wikidata, Schema.org, ...), detector coverage.

JSON: <http://registry.apicrafter.io/api/v1/datatypes/nanoid.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/identifiers/nanoid.yaml>
