RandomBasis

String to build

Random String Generator

Generate random strings of any length — letters, digits, symbols, hex or your own mix.

Runs locally in your browser. Nothing you generate is ever sent to a server.

Press "Generate" to build a string.

Preset

About this random string generator

Set a length, pick which character types to include, and press Generate. The result is a random string built from your chosen alphabet, ready to copy into code, a test fixture or a spreadsheet.

Presets for common alphabets

Alphanumeric covers letters and digits, which is the safest choice for identifiers that will travel through URLs and file names. Hex restricts the alphabet to 0-9 and a-f, matching colour values, hashes and many identifiers. Digits only produces numeric codes. Each preset simply sets the toggles below it, so you can adjust from there.

Guaranteed character types

If you ask for digits and symbols, a purely random fill can easily produce a string with neither. This generator places one character of each selected type first, fills the remaining positions from the full alphabet, then shuffles the whole thing — so the requirement is met without making the result predictable at any position.

Strings versus passwords

The two jobs look similar and are not the same. A password needs an entropy estimate and rules about ambiguous characters, which is what the password generator handles. A random string is for identifiers, API test tokens, file names, database seeds and placeholder data, where what matters is the alphabet and the length.

Common uses

How the randomness works

Every character is drawn from your browser's cryptographic random source, with values outside a clean multiple of the alphabet size discarded and redrawn so no character is quietly favoured. The final shuffle is a Fisher-Yates shuffle driven by the same source.

How do I generate a random string?

Set the length, choose which character types to include, and press Generate. The string appears ready to copy.

Can I generate a hex string?

Yes. The Hex preset restricts the alphabet to 0-9 and a-f, which is what you need for identifiers, colour values and test hashes.

Can I generate several strings at once?

Yes. Raise the quantity to draw up to 50 strings in one press and copy them all, one per line.

Does every string contain each character type?

Yes. If you ask for digits and symbols, at least one of each is guaranteed rather than left to chance, then the rest is filled randomly and shuffled.

Should I use this for passwords?

For a password, use the password generator instead — it scores real entropy and is built for that job. This tool is for identifiers, tokens and test data.

Is the string actually random?

Yes. Every character is drawn with your browser's cryptographic random source using rejection sampling, so no character is favoured.