Random string generator

A random string generator picks characters at random from a set you choose; this one uses the browser cryptographic generator.

Features

  • Unbiased selectionEach allowed character is equally likely.
  • Bulk outputUp to 500 strings at once.
  • Runs on your deviceYour data is processed in the browser and is never uploaded.

How to use the Random string generator

  1. Set length and quantity.
  2. Choose character sets.
  3. Copy or download.

Secrets and test data

The randomness is suitable for tokens, but anything copied to a clipboard or file can leak. Generate production secrets in your own secret manager where possible.

Secure random bytes in JavaScript

const bytes = crypto.getRandomValues(new Uint8Array(16));
const hex = [...bytes].map((b) => b.toString(16).padStart(2, '0')).join('');

Frequently asked questions

Is Math.random used?

No.

How long should a token be?

32 characters of letters and digits is about 190 bits.

Can I add my own characters?

Yes, in the extra characters box.

Related tools