Random String Generator

Generate up to 100 random strings of 1 to 1,000 characters from letters, digits, hex or your own character set, with an optional prefix and suffix. Uses the browser's crypto.getRandomValues.

Last updated

62 distinct characters · about 191 bits of randomness per string (length × log2 of 62)

About the Random String Generator

Set a length, choose how many strings you want and pick a character set: Alphanumeric (A–Z, a–z, 0–9), Letters Only, Numbers Only, Hexadecimal (0–9, a–f) or Custom. Press Generate Strings and the list appears, one string per line, ready to copy one at a time or all together.

Each character is chosen with crypto.getRandomValues, the browser's cryptographic random number generator, and values that would favour some characters are discarded, so every character in the set is equally likely. In Custom mode, repeated characters count once, so typing "aab" does not make "a" twice as likely. Under the character set buttons you can see how many distinct characters are in use and roughly how many bits of randomness each string carries (length × log2 of that number). A 32-character alphanumeric string carries about 191 bits.

The prefix and suffix are added unchanged to every string. They are handy for labelled values such as test_ user names or INV- reference codes, but they add no randomness.

Typical uses: test data for a form or database, coupon or invitation codes, temporary file names, or unique-looking IDs for a spreadsheet. For example, 50 eight-character codes from a custom set without look-alike characters (ABCDEFGHJKLMNPQRSTUVWXYZ23456789) make readable voucher codes. The list is not checked for repeats, so short strings drawn from a small set can repeat. For passwords with a strength meter, use the Password Generator; for UUIDs, use the Random Token Generator.

How to use the Random String Generator

  1. 1

    Set length and count

    Enter a String Length from 1 to 1,000 and a Count from 1 to 100.

  2. 2

    Pick a character set

    Click Alphanumeric, Letters Only, Numbers Only, Hexadecimal or Custom. For Custom, type the characters you want to allow.

  3. 3

    Add a prefix or suffix (optional)

    Text in Prefix and Suffix is added to the start or end of every string.

  4. 4

    Generate and copy

    Click Generate Strings, then Copy All for the whole list (one per line) or the copy icon beside a single string.

What it can do

Five character sets

Alphanumeric, letters, digits, lowercase hex or any characters you type, including accented letters and symbols.

Unbiased cryptographic randomness

crypto.getRandomValues with rejection sampling; every allowed character has the same probability.

Up to 100 strings at once

Each between 1 and 1,000 characters long.

Entropy shown

The bits of randomness per string are calculated from the length and the number of distinct characters.

Prefix and suffix

Fixed text added around every random part, for labelled codes and test values.

Limitations

  • Strings are not compared with each other, so duplicates are possible when strings are short or the character set is small.
  • The hexadecimal set is lowercase only.
  • There is no option to require at least one digit or symbol in each string; the Password Generator does that.
  • Results are not saved; copy them before you leave the page.

Privacy

Strings are generated by JavaScript in your browser and are not sent to FlexyPdf's servers or stored anywhere.

Frequently asked questions

Are the strings random enough for secret values?

The randomness comes from the browser's cryptographic generator without bias. Whether a string is strong enough depends on its length and character set; check the bits shown under the character set buttons. Around 128 bits or more is a common target for secret keys.

Can the same string appear twice?

Yes, nothing prevents it. With 4-digit numeric strings there are only 10,000 possibilities, and a list of 100 has roughly a 40% chance of containing a repeat. Longer strings or a larger character set make repeats extremely unlikely.

How do I avoid confusing characters like 0 and O?

Choose Custom and leave them out, for example ABCDEFGHJKLMNPQRSTUVWXYZ23456789. It leaves out 0, O, 1 and I, and because it uses capitals only there is no lowercase l either.

Does the prefix count towards the length?

No. The length applies only to the random part, and the prefix and suffix are added on top.

Ratings & Reviews

—
No ratings yet
5
0
4
0
3
0
2
0
1
0

Rate Random String Generator

Help others by sharing your experience. Your rating is shown without your name.

0/600