Random String Generator
Build random strings from exactly the characters you want.
Something went wrong
Processed locally in your browser. Nothing you type here is sent to our servers.
What does this tool do?
It produces random strings from exactly the characters you choose. Unlike the password generator, which is tuned for something a person might type, this is aimed at machine-readable values: API keys, tokens, nonces, test fixtures, temporary identifiers.
How the randomness works
Characters are drawn using crypto.getRandomValues() with
rejection sampling. That second detail matters more than it sounds.
The obvious approach — take a random number and apply % alphabetLength —
is subtly biased whenever the alphabet size does not divide the generator's range
evenly. Some characters then come up measurably more often than others, which
reduces the real entropy of every string you generate. Rejection sampling discards
values that fall in the incomplete final bucket and draws again, so every character
is equally likely.
How to use it
- Set the length and how many strings you want.
- Choose the character sets to draw from.
- Exclude look-alike characters if the string will ever be read aloud or typed by hand.
- Copy the results, or download them one per line.
At least one from each set guarantees every selected set appears at least once — useful when a downstream system enforces a composition rule. It costs a negligible amount of entropy and saves you regenerating until a rule is satisfied.
Common use cases
- API keys and client secrets for a service you are building.
- Session tokens, CSRF tokens and one-time nonces.
- Temporary passwords that will be rotated on first use.
- Unique filenames or cache-busting suffixes.
- Realistic-looking test data.
Limitations
- Entropy is reported for a uniform draw over the selected alphabet. Excluding look-alikes shrinks the alphabet and therefore lowers it slightly — the footer always shows the real figure.
- Generated strings are not stored anywhere. Regenerating or leaving the page loses them.
- For anything long-lived, generate it here and put it straight into a secrets manager rather than leaving it on screen.
- The symbol set is deliberately conservative and avoids characters that commonly need shell escaping.