Skip to main content
Screendesk
Free tool

Random String Generator

Cryptographically secure random strings for API keys, tokens, passwords and test data, with the entropy shown in bits.

Open source on GitHub

Settings

Presets

Characters
Character set size62
Entropy per string95.3 bits
StrengthStrong

Random strings

Press Generate to create strings.

Runs entirely in your browser. Nothing you paste here is uploaded or stored.

Reference

Entropy by character set. Bits per character, and the length you need for about 128 bits.

Entropy per character set
Character setBits per charLength for ~128 bitsTypical use
Digits only (10)3.3220 chars → 66 bits6-digit PINs (19.9 bits) only work with rate limiting.
Hex (16)4.0032 chars → 128 bitsSession IDs, secrets stored as hex.
Lowercase + digits (36)5.1725 chars → 129 bitsCase-insensitive identifiers and URLs.
Alphanumeric (62)5.9522 chars → 131 bitsAPI keys and tokens.
Alphanumeric + symbols (89)6.4820 chars → 130 bitsPasswords stored in a password manager.
Strength

How many bits is enough? How the strength label maps to entropy.

Strength by entropy
EntropyLabelWhat it means
Under 40 bitsWeakGuessable offline in seconds to hours. Fine only for short-lived codes behind rate limits.
40–63 bitsFairResists online guessing, not a determined offline attack.
64–99 bitsStrongGood for most passwords and invite codes.
100+ bitsVery strongRecommended for API keys, tokens and secrets (128 bits is a common target).
FAQ

Frequently asked questions

Are these random strings secure?

Yes. Characters are chosen with crypto.getRandomValues, the browser’s cryptographically secure random number generator, not Math.random. Strings are generated on your device and never sent anywhere.

What is modulo bias and how is it avoided?

Mapping a random 32-bit number onto, say, 62 characters with the remainder operator makes the first few characters slightly more likely, because 2^32 does not divide evenly by 62. This generator uses rejection sampling: it discards random values from the uneven top of the range and draws again, so every character is exactly equally likely.

How is entropy calculated?

Entropy in bits is length × log2(character set size). A 16-character alphanumeric string has 16 × log2(62) ≈ 95 bits. Each extra bit doubles the number of guesses an attacker needs. Duplicate custom characters are removed first, so they don’t inflate the number.

Which characters count as ambiguous?

Characters that are easy to misread or mistype: I, l, 1, O, 0, o, the pipe and backtick, quotes, and look-alike pairs such as 5/S, 2/Z and 8/B. Excluding them is useful for codes people read from a screen or type by hand. It slightly lowers entropy per character, which the strength meter shows.

How many strings can I generate at once?

Up to 1,000 strings of up to 1,024 characters each. Turn on No duplicate strings to guarantee every string in the batch is unique.

Customer support runs on Screendesk.

Start for free