Skip to content

Random String Generator

Produce random tokens, IDs and test strings from the character set you need.

Processed locally in your browser

Options

Used when the character set is "Custom". Duplicates and spaces are ignored.

What is Random String Generator?

A random string is a sequence of characters picked independently and uniformly from an alphabet. It is the standard shape of API keys, session identifiers, invite codes, coupon codes and test fixtures. Quality depends on two things: a cryptographic random source and unbiased selection.

This tool draws each character with crypto.getRandomValues and rejection sampling. Pick a preset (alphanumeric, letters, digits, lowercase hex, Base64url) or supply your own characters, set the length (up to 4,096) and how many strings to create, and see the entropy per string.

How does it work?

  1. Choose a character set, or select "Custom" and type the exact characters allowed.
  2. Set the length and the number of strings.
  3. Press Generate and copy the result, one string per line.

Common use cases

  • Generating API keys, invite codes or one-time tokens for a prototype.
  • Creating unique file names or database test keys.
  • Building coupon codes from an alphabet without look-alike characters.
  • Filling forms and fixtures with realistic random text.

Examples

Produce random tokens, IDs and test strings from the character set you need.

Privacy

Random String Generator runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.

Limitations

Strings are generated locally and shown on screen; treat them like any secret you copy. For passwords with mixed-set guarantees use the Password Generator, and for UUIDs use a UUID tool.

Frequently asked questions

How long should a token be?

For unguessable tokens aim for at least 128 bits of entropy: 22 characters of Base64url, 32 hex characters or 22 alphanumeric characters.

What does Base64url mean here?

The URL-safe alphabet A–Z, a–z, 0–9, "-" and "_". Strings from it can be used in URLs and file names without escaping.

Are duplicate characters allowed inside a string?

Yes. Each position is drawn independently, as in real tokens. Custom character sets are de-duplicated so each character is equally likely.

More tools in Developer Tools →