Random String Generator

String Length
Number of Strings
Character Sets
Next

Generate random strings from 1 to 256 characters long using any combination of character sets: uppercase, lowercase, digits and symbols. Useful for placeholder values, test fixtures, identifiers and throwaway labels. Each character is drawn with a cryptographically secure random number generator, so the output is uniformly random.

How to generate a random string

  1. 1

    Pick the length

    From 1 to 256 characters per string.

  2. 2

    Select character sets

    Uppercase, lowercase, digits, symbols: tick any combination.

  3. 3

    Set how many

    Generate from 1 to 100 strings in a single batch.

  4. 4

    Generate

    Copy the result, or generate a fresh batch at once.

Common use patterns

Use Length Charset
Test fixture ID 8-12 lowercase + digits
URL slug 6-10 lowercase + digits + dash
Nonce / CSRF token 32 alnum
API key (hex) 32-64 lowercase + digits
Password 16+ alnum + symbols

Not a password generator

For actual user passwords, prefer the dedicated password generator, it adds category guarantees (at least one digit, one symbol) and a strength meter. This tool is better suited to raw string fixtures where you just need pseudorandom characters.

Entropy check

Entropy in bits is length * log2(alphabet size). An 8-character lowercase-only string has 8 * log2(26) = 37 bits of entropy, trivially brute-forceable. A 16-character alnum string has 16 * log2(62) = 95 bits, borderline strong. For cryptographic uses, aim for 128 bits (22 alnum characters or 32 hex).

Frequently Asked Questions

Each character comes from a cryptographically secure random number generator, not a predictable source. For user-facing secrets like passwords or API keys, prefer the dedicated generators, which also apply constraints such as “must contain at least one digit”.

Any mix of uppercase (A-Z), lowercase (a-z), digits (0-9) and symbols (!@#$%^&*()-_=+[]{}|;:,.<>?). At least one set must be enabled to produce a string.

Up to 256 characters per string, and up to 100 strings per batch. For more output, generate several batches.

Each generation is independent. For a 20-character alphanumeric string, the collision probability over a billion generations is astronomically small, but not zero.

Related Tools

Tool available in other languages