Random String Generator

Share randomizer:
Embed this tool:

Edit the character set, choose a string length and how many strings you want, then press the button. Options let you force uppercase, avoid repeated characters, or keep every string different.

How to generate a random string

The Characters to use box holds the alphabet the generator draws from. It starts with the lowercase and uppercase English letters, the digits 0 to 9 and a block of punctuation, 87 characters in all. Delete what you do not want or add your own: accented letters, other alphabets, emoji or any symbols all work.

Characters are separated by spaces, commas, tabs or line breaks, which means a space or a comma can never be one of the characters itself. An entry does not have to be a single character either: if you list foo and bar, a string of length 3 is made of three of those words, such as barfoobar. At least two entries are required.

Set String length (1 to 1,000) and Number of strings (1 to 10,000), then press Generate Random String. Every position of every string is drawn independently from the alphabet. The output has one string per line, ready to copy.

What the three checkboxes do

  • Output in uppercase converts the finished strings to capitals. Entries that differ only in case (a and A) then become the same entry, so the alphabet effectively shrinks.
  • Unique characters in string stops a character from appearing twice inside one string. The string length cannot then exceed the number of different characters available, and you get an error if it does.
  • Unique strings only makes every string in the output different from the others, as you would want for raffle tickets or voucher codes. It only matters when you ask for more than one string.

A character listed several times has proportionally more chance of being drawn. Entering a a a b makes about 75% of the characters an a, which is a quick way to weight an alphabet. (When unique strings are on, repeats in the list are ignored and every distinct entry is equally likely.)

How many different strings are possible?

With n distinct entries and a string length of L (written n^L, n to the power L), characters can repeat and each position has n choices:

possible strings = n^L

If characters may not repeat, the first position has n choices, the second n − 1, and so on:

possible strings = n × (n − 1) × … × (n − L + 1)

Banning repeats removes about 38% of the 8-character strings over 62 symbols (136,325,893,334,400 ÷ 218,340,105,584,896 ≈ 62.4% remain).
AlphabetLengthPossible strings
10 digits410,000
26 lowercase letters6308,915,776
36 lowercase letters and digits62,176,782,336
87 default characters54,984,209,207
62 letters and digits8218,340,105,584,896
62 letters and digits, no repeated character8136,325,893,334,400

When Unique strings only is ticked, the tool checks your count against this total. Three digits allow at most 103 = 1,000 different strings, so 1,001 unique ones is impossible, and so are five unique strings of length 2 over two characters (22 = 4).

Duplicates by chance

Even a large space can produce a repeated string if you generate many of them, a version of the birthday problem. For k strings drawn from N possibilities, the chance of at least one repeat is approximately:

P(repeat) ≈ 1 − exp(−k × (k − 1) ÷ (2 × N))

Example: 1,000 codes made of 6 lowercase letters or digits (N = 2,176,782,336) have a repeat chance of about 0.023%. Ask for 10,000 codes and it grows to about 2.3%. If even that is unacceptable, tick Unique strings only and the generator rejects duplicates for you.

Typical uses and cautions

Random strings suit placeholder data, test fixtures, raffle tickets, invite codes and short IDs. To decide the order in which generated tickets are drawn, paste them into the list randomizer.

For a password, prefer the dedicated random password generator, which is designed around password rules. For letters only or letters and digits, try the random alphanumeric generator or the random letter generator.

Looking random is not the same as being secret. Strings made on a web page are fine for codes and test data, but anything that protects an account or encrypts data should come from a tool or library built for that purpose.

Frequently asked questions

Can I use a space or a comma as one of the characters?

No. Spaces, commas, tabs and line breaks are the separators between entries, so they cannot be characters themselves. Any other symbol, including accented letters and emoji, can be used.

What is the longest string and the largest batch I can make?

A string can be up to 1,000 characters long and you can generate up to 10,000 strings in one go. The character set needs at least two entries.

How do I get strings that never repeat a character?

Tick Unique characters in string. Each character then appears at most once per string, so the length can be no larger than the number of different characters in your set.

Why does the unique strings option sometimes give an error?

Because fewer different strings exist than you asked for. The total is n to the power L, where n is the number of different entries and L the length, or n × (n − 1) × … when characters may not repeat. Add characters, lengthen the string or ask for fewer strings.

Cite this randomizer and page

If you use this page in your work, you can cite it as:

Reeliy Editorial Team. (2026). Random String Generator. Reeliy. https://reeliy.com/randomizers/random-string-generator“Random String Generator.” Reeliy, 2026, https://reeliy.com/randomizers/random-string-generator.