Random String Generator

Generate a random string of a chosen length and character set — for test data, sample IDs, or anything else — computed locally in your browser.

Security Tools

Choose a length and character set below and generate a random string. Everything runs in your browser using a cryptographically secure random source — nothing is sent to our server.

Generated locally in your browser — nothing is sent to our server.

Computed entirely in your browser — nothing you enter here is sent to our server.

How This Tool Works

This tool draws each character from your chosen set using crypto.getRandomValues() — a cryptographically secure random source — with rejection sampling to avoid modulo bias, so every character in the set has a genuinely equal chance of appearing regardless of the set’s size. Useful for generating test data, sample identifiers, placeholder values, or anything else that needs to look random without necessarily being a secret you need to remember (for a password specifically, see this site’s Password Generator).

FAQ

Is my data uploaded anywhere?

No. The string is generated entirely in your browser. Nothing is sent to our server.

How is this different from the Password Generator?

Same underlying random-generation technique, but this tool is framed for general-purpose random strings (test data, sample IDs) rather than as a secret you’d need to remember and protect.

What’s “modulo bias” and why does it matter here?

Naively mapping a random byte (0-255) onto a character set with, say, 62 characters using % 62 would make lower character indices very slightly more likely than higher ones, since 256 doesn’t divide evenly by 62. This tool avoids that by discarding out-of-range bytes and drawing again, so the result is genuinely uniform.