How to use this random string generator
- Length, set how many characters each string should have.
- Character sets, tick lowercase, uppercase, numbers and symbols to shape the pool, and tickExclude ambiguous to drop 0, O, 1, l and I.
- Custom characters, optionally type your own characters to add to the pool, or untick every checkbox above to generate from only those characters, handy for hex-style strings such as
ABCDEF0123456789. - How many, choose how many strings to produce at once (up to 1,000), then press Generate.
- Hit Copy to grab the whole batch, or export it as a .txt file or a .csv file. Change any field and the batch refreshes instantly.
Uses for random strings
- API keys. A long random string of letters and numbers makes a strong, hard-to-guess key for services and integrations.
- Tokens. Session tokens, reset tokens and CSRF tokens all rely on unpredictable random values to stay safe.
- Test IDs. Need unique identifiers for test fixtures, sample records or seed data? Generate a batch in one click and export it as a CSV file.
- Salts. Random salts strengthen password hashing by making each stored hash unique, even for identical passwords.
- Hex-style values. Use custom characters to restrict the pool to
0-9A-Ffor hex-like tokens, or to any other exact alphabet a system requires.
Built on the browser crypto RNG
This tool picks every character with crypto.getRandomValues, the browser cryptographically-secure random number generator, not the weaker Math.random. It uses rejection sampling so each character is chosen uniformly from your selected pool, with no bias toward any value. The result is high-entropy output that is suitable for secrets: a 32-character string drawn from letters and numbers is practically impossible to guess.
Custom character sets and bulk export
Beyond the four standard checkboxes, the Custom characters box accepts any exact set of characters you want, for example a hex-style alphabet, a specific symbol set, or a pool that leaves out characters your system can't handle. Duplicate characters are removed automatically, and the Exclude ambiguous checkbox strips 0, O, 1, l and I from the final pool, useful when a string will be read aloud, typed by hand, or printed somewhere the font makes those characters hard to tell apart.
The How many field generates up to 1,000 strings in one batch. Copy the whole list with one click, or export it as a plain .txt file (one string per line) or a .csv file with a header row, ready to import into a spreadsheet or a test fixture.
Frequently asked questions
Are these strings really random?
Yes, they use crypto.getRandomValues, the browser cryptographically-secure generator, with rejection sampling for an unbiased result.
What length should I pick for a secret?
Use 32 or more characters with letters and numbers enabled for API keys, tokens and salts.
Can I generate many at once?
Yes, set the "How many" field (up to 1,000) and generate a batch, then copy it all or export it as a .txt or .csv file.
Can I restrict the pool to my own characters?
Yes, type any set of characters into the "Custom characters" box. Untick the four standard checkboxes to use only your custom characters, or leave them ticked to add your characters on top.
What does "Exclude ambiguous" do?
It removes 0, O, 1, l and I from the pool, characters that are easy to misread or mistype when a string is written down or read aloud.