How to use the random string generator
- Set the Length, from 1 to 4,096 characters (24 by default).
- Tick the sets to draw from: Uppercase, Lowercase, Digits and Symbols. The first three are on by default.
- Tick Exclude look-alikes to drop 0, O, o, 1, l and I.
- Or type your own characters into Custom character set (overrides the boxes).
- Set How many strings (up to 1,000) and press Generate.
What it does and when to use it
Developers and testers need random text all the time: a salt or a secret for a config file, a long token for a test, filler data to check how a form handles 255 characters, or a batch of codes made only from letters a customer can read easily. This tool covers all of those with one length setting and one alphabet.
The custom box is the flexible part. Type ACGT for random DNA sequences, 01 for binary strings, or ABCDEFGHJKMNPQRSTUVWXYZ23456789 for codes that avoid confusing characters. If you only need hexadecimal, the random hex generator works in bytes and can add a 0x prefix. For short IDs with a collision estimate, use the Nano ID generator. For codes with a prefix and dashes, see the coupon code generator.
How it works
The tool joins the chosen sets into one alphabet, removes look-alikes if asked, and then picks each character with crypto.getRandomValues. Rejection sampling makes every character in the alphabet equally likely, even when the alphabet size does not divide evenly into 2^32.
Entropy per string = length × log2(alphabet size). It is a fair measure here because every character is chosen independently and uniformly. Character set size is the alphabet size after removals.
Worked examples
- Defaults. 24 characters from upper case, lower case and digits (62 symbols) give
Entropy per string: 142.9 bits. - A small custom set. Length 8 with the custom set
ABC123givesCharacter set size: 6and 20.7 bits per string, with outputs like12BA3C11. That is fine for a demo but easy to guess. - Everything except look-alikes. Length 32 with symbols on and look-alikes excluded leaves
Character set size: 70and 196.1 bits per string. - A set that is too small. A custom set of
zzzholds one distinct character, so the tool answers “Choose at least two different characters to draw from.”
Limits and tips
- The tool does not remove duplicates across a batch. With short strings from a small set, repeats are likely.
- Very long strings in large batches can make the page slow to display; copy them out and clear the page.
- A random string is only secret until it is shared. Do not paste live secrets into chat or tickets.
Frequently asked questions
Which symbols are included?
How does the custom character set work?
How long should a random string be?
Is this the same as a password generator?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.