Random String Generator
Generate cryptographically random strings from a configurable character pool. Bulk count supported.
About Random String Generator
This is a general-purpose random string generator that lets you pick the character pool yourself. Unlike the password generator (which is tuned for human-typed passwords), this is suited for machine identifiers, nonces, API keys, and other random tokens where you want full control over the alphabet.
When to use it
- Generating API keys or session tokens
- Producing random sample IDs for testing
- Creating nonces for CSRF tokens or signed URLs
- Building short URL slugs
How it works
A character pool is built from the selected presets and any custom characters you add. For each output position, crypto.getRandomValues produces a random index. Modulo bias is avoided via rejection sampling — the index is re-drawn until it falls within the largest multiple of the pool size that fits in the random value's range.
Examples
Length=12, lowercase+digits
a4k7zq2p9wn5
Frequently asked questions
- How is this different from the password generator?
- The password generator is tuned for human-typed passwords (separate uppercase/lowercase/digit/symbol toggles, exclude-similar option). This tool lets you specify any character pool, including non-ASCII characters via the custom field — useful for tokens that machines will consume.
- Is the randomness secure?
- Yes. crypto.getRandomValues is the browser's CSPRNG, suitable for security tokens. Math.random is not used.
- Can I use my own alphabet?
- Yes. Add any characters to the 'Custom' field; they're appended to whatever presets are enabled. Duplicates are deduplicated.