Random String Generator
Generate random strings for test data, IDs, and codes. Choose the length, the characters to use, and how many you need, then copy them all at once.
How to use the random string generator
- Set the length. Any length from 1 to 256 characters, or tap 8, 12, 16, 32, or 64.
- Choose the characters. Mix lowercase, uppercase, numbers, and symbols, or type your own set (like 0-9 and A-F for hex).
- Pick how many. Make one string or up to 100 at once.
- Copy or download. Copy them all, one per line, or save them as a .txt file.
Common random string formats
| Format | Characters | Length | Used for |
|---|---|---|---|
| Alphanumeric | a-z, A-Z, 0-9 | 16 to 32 | API keys, tokens, test data |
| Hex | 0-9, a-f | 32 or 64 | Hashes, color codes, IDs |
| Short ID | a-z, 0-9, no look-alikes | 6 to 10 | Order numbers, invite codes, short links |
| PIN | 0-9 | 4 to 6 | Verification codes, door codes |
| Strong string | All four sets | 20+ | Secrets and passwords |
How random are the strings?
Every character is picked with your browser's cryptographic random number generator (crypto.getRandomValues), using rejection sampling so each character in the set is exactly as likely as any other. The tool shows how many bits of randomness each string has: length times log2 of the set size. A 16-character string of letters and numbers has about 95 bits, far beyond guessing.
Strings are made on your device and never sent anywhere. To check how long a string or any text is, use the character counter.
Related tools
Frequently asked questions
How long can a random string be?
Anywhere from 1 to 256 characters. You can make up to 100 strings at once.
Can I choose which characters to use?
Yes. Mix lowercase, uppercase, numbers, and symbols, or type your own characters, like 0123456789abcdef for hex.
Can I use it to make passwords?
Yes. Strings come from your browser's cryptographic random number generator and never leave your device. Use 16 or more characters with all four character sets.
What does "Avoid look-alikes" do?
It leaves out characters that are easy to confuse, like 0 and O or 1, l, and I, which helps when people have to read or type the string.
Is every character equally likely?
Yes. The tool uses rejection sampling, so there is no bias toward any character in the set.
How do I get a random hex string?
Tap the "Hex 32" preset, or type 0123456789abcdef into Custom characters and set the length.
More wordcounter.ai tools
Other tools you might find useful.