How to Use This Tool
Short random IDs trade storage and readability against collision risk. The useful question is not whether a ten-character ID looks random; it is how many possible IDs exist and how many records will compete for that space. This page reports both entropy and the birthday-bound probability for your expected count.
Uniform selection matters
A common custom generator takes a random byte modulo the alphabet length. When 256 is not evenly divisible by that length, some symbols occur more often than others. The samples here reject out-of-range bytes before mapping them, preserving a uniform distribution, and use the browser's cryptographically strong random source rather than Math.random.
Uniqueness still belongs in the database
A negligible probability is not a uniqueness guarantee. Keep a unique index on the identifier and retry generation if insertion reports a collision. Random public IDs also should not replace authorization: an unguessable-looking URL is not permission to read the record behind it.
Sources & assumptions
Tool Spec v2 · verified 2026-08-18. Platform rules and fees can change; the editable inputs remain authoritative for your account.
Official references
- Nano ID — official repository and security guidance (checked 2026-08-18)
- MDN — Crypto.getRandomValues (checked 2026-08-18)
Model assumptions
- Collision probability assumes every character is selected independently and uniformly from the entered unique ASCII alphabet.
- The birthday-bound estimate models accidental random collisions, not hostile guessing or leakage of identifiers.
