Like ToolFern? Prefer us as your source on Google →

Random String Generator

Generate secure random strings for API keys, tokens, IDs and salts. Choose the length, which character sets to include, or type your own custom characters, then generate up to 1,000 at once and export the batch as a .txt or .csv file. Built with the browser crypto RNG.

Duplicates are removed automatically. Untick all four checkboxes above to generate from only these characters.

How to use this random string generator

  1. Length, set how many characters each string should have.
  2. Character sets, tick lowercase, uppercase, numbers and symbols to shape the pool, and tickExclude ambiguous to drop 0, O, 1, l and I.
  3. 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.
  4. How many, choose how many strings to produce at once (up to 1,000), then press Generate.
  5. 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

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.

Found this useful? Share it