Nano ID generator

Generate short, URL-safe random IDs of any length, optionally from your own alphabet.

Input

Characters per ID.
How many to generate.
Characters to draw from, each listed once. Left out, A-Z, a-z, 0-9, "_" and "-" are used.

Result

Fill in the input and press Run.

Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.

Use it from code or an agent

curl -s https://setget.net/v1/tools/nanoid \
  -H 'Content-Type: application/json' \
  -d '{"input":{}}'
import json, urllib.request

body = {'input': {}}
request = urllib.request.Request("https://setget.net/v1/tools/nanoid", json.dumps(body).encode(),
                                 {"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/nanoid", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({"input":{}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
  "slug": "nanoid",
  "input": {}
}
{
  "input": {}
}

Endpoint: POST /v1/tools/nanoid. Over MCP: run_tool with slug: "nanoid". Machine-readable: input schema, Markdown. Connect an agent.

Inputs

NameTypeRequiredWhat it does
size integer no Characters per ID. Default: 21. From 1 to 256.
count integer no How many to generate. Default: 1. From 1 to 100.
alphabet string no Characters to draw from, each listed once. Left out, A-Z, a-z, 0-9, "_" and "-" are used.

Examples

One standard 21-character ID

Input
{}
Result

Different every time. Press the example button above to see one.

Five short hex IDs

Input
{
  "size": 10,
  "count": 5,
  "alphabet": "0123456789abcdef"
}
Result

Different every time. Press the example button above to see one.

Questions

How likely is a collision?
With the default 21 characters there are 126 random bits, about the same as a random UUID. Shorter IDs or smaller alphabets collide sooner; "entropy_bits" in the result shows the strength.
Is the output evenly random?
Yes. Each character is drawn from the operating system's secure random source without modulo bias.