Skip to content

Random string generator

Create random strings for test data, tokens, coupon codes or IDs. Set the length, pick the characters, and generate up to 1,000 at once with a secure generator.

  • Free, no limits
  • No sign-up
Everything happens in your browser; your data is never uploaded.
  • ✓ Free
  • ✓ No sign-up
  • ✓ Nothing uploaded

Next step

What to do next

How to use it

  1. Set the length and how many strings you need.
  2. Pick lowercase, uppercase, digits and symbols, or type a custom character set.
  3. Optionally exclude look-alike characters such as 0, O, 1 and l.
  4. Click Generate, then copy or download the list.
Try it now

Options

  • Length: 1 to 4,096 characters per string.
  • How many: up to 1,000 strings per click, one per line.
  • Character sets: lowercase a–z, uppercase A–Z, digits 0–9, and symbols !@#$%^&*()-_=+[]{};:,.?/.
  • Exclude look-alikes: removes 0 O o 1 l I, which are easy to misread when a code is printed, read aloud or typed from a screen.
  • Custom character set: type any characters, and only those are used. For example 0123456789ABCDEF gives hex strings, and ACDEFGHJKLMNPQRTUVWXY34679 gives unambiguous voucher codes.

Below the result, the tool shows how many distinct characters were used and the entropy of each string in bits.

How secure are the strings?

The strings come from your browser's cryptographically secure random number generator (crypto.getRandomValues), the same source used for encryption keys. The tool also avoids modulo bias, a subtle flaw where some characters come up slightly more often than others, by discarding random values that would skew the distribution.

Entropy measures how hard a string is to guess: length × log2(number of possible characters).

CharactersLengthEntropy
Digits only (10)6about 20 bits
Letters and digits (62)16about 95 bits
Letters and digits (62)24about 143 bits
Letters, digits, symbols (86)32about 206 bits

For API keys, session tokens and other secrets, aim for at least 128 bits: for example 22 or more characters from letters and digits.

Examples of useful settings

PurposeSettingsExample
API key32 characters, letters and digitskq7XbR2mTz9LwP4vNc8sYh1JdF6gUe3a
Voucher code8 characters, uppercase and digits, exclude look-alikesK7RX4MZT
Numeric PIN for testing6 characters, digits only583920
Hex secret64 characters, custom set 0123456789abcdef256-bit key in hex
Strong secret with symbols40 characters, all setsfor .env session secrets

The examples above are illustrations, not values to reuse: generate your own. If a system rejects certain symbols, such as quotes or backslashes in configuration files, use a custom character set without them.

Typical uses

  • Test data: fill database columns, forms and load tests with realistic random values.
  • Tokens and secrets: API keys, webhook signing secrets, CSRF tokens, .env values such as session secrets.
  • Coupon and invite codes: short uppercase codes without look-alike characters, easy to type from a printed flyer.
  • Temporary file names and unique suffixes.
  • Salts and nonces for development and testing.

Everything is generated locally. The strings are not sent to or stored on any server, so they are safe to use as real secrets.

Random strings vs. passwords and UUIDs

A random string is the most flexible option, but for some jobs a specialized tool fits better:

  • For a password a person must type or remember, a passphrase of several random words is easier to use at the same strength. Our password generator handles that.
  • For database IDs, a UUID is the standard format and every database and language understands it.
  • For short codes, check the collision risk: with 6 uppercase letters and digits (36 characters) there are about 2.2 billion combinations, but by the birthday paradox you would expect a duplicate after roughly 55,000 random codes. Store issued codes and check new ones against them.

Frequently asked questions

Are these random strings secure?

Yes. They are generated with the browser's cryptographically secure random number generator, locally on your device.

How long should an API key or token be?

Aim for at least 128 bits of entropy, for example 22 or more characters from upper- and lowercase letters and digits.

How do I make codes that are easy to read?

Tick Exclude look-alikes, or use a custom set without 0, O, 1, I and l, and use uppercase letters only.

Can I generate many strings at once?

Yes, up to 1,000 per click, one per line, and download them as a text file.

Can I use my own characters?

Yes. Type them into the custom character set field and only those characters are used.

Last updated: November 12, 2026

Recommended

Similar tools

If Random string generator helped, you may need these too.

See all in category →

People also use