Code

Plan a Random String with an Exact Character Alphabet

·

Secure Random String Generator independently samples each position from an alphabet. Use it when a receiving system permits a defined set of characters, then check length and alphabet against that system’s requirements.

Secure Random String Generator

Generate 32 lowercase hexadecimal characters

Set Character alphabet to Lowercase hexadecimal, Characters per string to 32, and Number of strings to 3. The preview shows 16 choices per character and 128.0 theoretical bits per string. Each draw contributes four bits because log₂(16) equals 4.

Press Generate strings. Check that every row has 32 characters drawn from 0–9 and a–f. The values vary with each run. Copy a single value from its row or download all three as UTF-8 text with one value per line.

Open the Secure Random String GeneratorW3C Web Cryptography API getRandomValuesRFC 4648 Base16 and Base64url alphabets

Check a custom alphabet with repeated characters

Choose Custom alphabet and enter AAB🌿. The two A characters collapse to one choice. Set length to 4 and expect three choices per position and 6.3 theoretical bits per string. Each result contains four code points selected from A, B and 🌿, including repeats.

Length counts Unicode code points. A single displayed grapheme can contain several code points. Equivalently displayed Unicode spellings remain distinct if their individual code points differ. The tool leaves the supplied alphabet spelling intact after removing duplicates.

Open the Secure Random String Generator

Understand the bit estimate and copy behavior

The tool takes cryptographically strong random values from the browser. Before reducing a 32-bit draw to a character index, it rejects the short group at the end that would otherwise favor some characters. The reported length times log₂ of the number of unique characters is a model of the possible strings.

The page makes no request with the custom alphabet or generated strings. Editing settings or clearing results discards the current output. Copy and Download intentionally create copies that remain outside the workspace.

W3C Web Cryptography API getRandomValuesRFC 4086 Randomness Requirements for Security

Common questions

Is a 22-character Base64url-alphabet string a Base64url encoding of 16 bytes?

This option samples each of the 22 characters from a 64-character alphabet. An RFC 4648 encoding of exactly 16 bytes has constraints on the final character and padding. Check which representation the receiving system requires.

What is the difference from the password generator?

The password generator can guarantee a character from each enabled class. The string generator chooses independently from one alphabet, so a result can omit some character classes.

How do I copy the batch or one string?

Use Copy next to a row for that value, or Copy batch for all visible results separated by line feeds. Download TXT creates a file with a final line feed.

Sources

Put it into practice.

Related guides