Random String Generator

Random tokens of any length and character set.

Free. Runs in your browser: nothing you enter or open is uploaded.


Each character is picked with the Web Crypto random number generator and rejection sampling, so every character in the alphabet is exactly equally likely. Nothing is sent or stored.

How to use it

  1. Set the length and how many strings you need.
  2. Tick the character sets, or type your own alphabet.
  3. Press Generate, then copy them all or download a text file.

Questions

Is this random enough for API keys and tokens?

Yes. It uses the same cryptographic random generator browsers use for encryption keys, with no bias between characters. For a key, aim for at least 128 bits, shown under the options.

What does rejection sampling mean?

Random bytes come in 256 values, which rarely divides evenly by the alphabet size. Values that would make some characters more likely are thrown away and drawn again, so every character has the same chance.

How long should a random token be?

22 characters from letters and digits give about 128 bits, which is enough for session IDs and API keys. 32 hex characters also give 128 bits.

Can I use emoji or other alphabets?

Yes. Type any characters into the custom alphabet. Each distinct character counts once, even if you type it twice.