Random string generator

Pick a character set and a length and get as many random strings as you need: tokens, ids, test data, coupon codes or keys. Generated in your browser with a secure random source.

  • Free
  • No sign-up
  • Runs in your browser
random-string-generator

100% private — everything is generated in your browser with its secure random number generator, and nothing is sent or stored.

How it works

Choose the characters

Letters, digits, hex, base64 URL-safe, base32 or your own.

Set the length and quantity

Up to 4,096 characters and 1,000 strings.

Copy or download

Add a prefix or suffix if you need one.

Random text for every occasion

Random strings are the raw material of many small tasks: an API token, a unique id for a record, a coupon code, a temporary key, a test fixture, a cache-busting value, a salt or a filler value for a spreadsheet. Writing a script for each one is overkill, and typing what looks random by hand is not really random. This tool produces as many as you want from the set of characters you choose.

The character sets

  • Letters and digits is the general-purpose choice for tokens and ids.
  • Hexadecimal gives the 0 to 9 and a to f used in hashes, colour codes and many identifiers.
  • Base64 URL-safe uses letters, digits, hyphen and underscore, so the result can go inside a URL without escaping.
  • Base32 uses capital letters and the digits 2 to 7, avoiding characters that look alike, which suits codes that people have to read or type.
  • Your own characters lets you define the alphabet, for example only certain letters for a coupon code that avoids vowels.

Truly random, and uniform

The randomness comes from your browser's cryptographic random number generator, and each character is picked without the bias that a simple remainder calculation introduces, so every character in the set is equally likely. The tool shows the number of bits of randomness in each string, which tells you how hard one would be to guess: a 16-character string from 62 characters has around 95 bits.

Prefixes, suffixes and no repeats

Add a prefix or suffix to make identifiers such as usr_ followed by the random part. Keep "No repeated strings" ticked to guarantee that every string in the list is different, useful for coupon codes and ids.

What it does not do

The strings are random but carry no meaning and no checksum. If you need passwords, use the password generator, which guarantees character types and rates strength, and for standard identifiers use the UUID generator. Nothing is stored or sent.

Frequently asked questions

How do I generate a random string?
Pick the character set and the length. A list of random strings appears and you can copy it.
Is the output really random?
Yes. It uses the secure random number generator of your browser, and each character has the same chance.
Can I make codes that avoid look-alike characters?
Yes: use Base32, or choose your own characters and leave out the ones that can be confused.
How do I get a random hex string?
Choose Hexadecimal and the length you need, for example 32 for 128 bits.
Can I be sure there are no duplicates?
Keep "No repeated strings" ticked and every string in the list is different.
Is anything sent or stored?
No. Everything is generated in your browser.