Random

Random String Generator

Generate secure random strings with configurable length and character sets.

Quick guide

How to use the Random String Generator

  1. Enter or choose string length, characters, how many strings?.
  2. Select Generate string.
  3. Review the main result, supporting breakdown, and step-by-step calculation notes.
  4. Copy the output or download the generated file when available.

What this tool does

Generate cryptographically secure random strings, tokens, API test secrets, and hex keys up to 2,048 characters long directly inside your browser. Using Web Crypto API rejection sampling guarantees uniform character distribution with zero modulo bias and zero server transmission.

Entropy (bits) = Length × log₂(Alphabet Size)

Calculation method

  1. Build the chosen character alphabet: Alphanumeric (62 chars), Letters (52), Hexadecimal (16), or Full ASCII with symbols (78).
  2. Sample every character position independently with crypto.getRandomValues() and rejection sampling to eliminate modulo bias.
  3. Generate between 1 and 100 strings per batch and present them line-by-line for quick copy.

Example: five 24-character alphanumeric tokens

Input: Length: 24; Characters: Letters and numbers (62 chars); Count: 5

Result: 5 unique 24-character strings (~142.9 bits of entropy each)

With 62 possible characters per position, 24 × log₂(62) ≈ 142.9 bits of entropy—exceeding standard 128-bit cryptographic token strength.

Approximate entropy by alphabet and length

AlphabetSize16 chars24 chars32 chars
Hexadecimal (0–9, a–f)1664 bits96 bits128 bits
Letters only (A–Z, a–z)5291 bits137 bits182 bits
Alphanumeric6295 bits143 bits190 bits
Letters, numbers & symbols78101 bits151 bits201 bits

Practical uses

  • Generating local development API keys and webhook secrets
  • Creating strong random passphrases or salt values
  • Producing 32-char or 64-char hex keys for testing
  • Creating unique coupon or invite codes

Accuracy tips and common mistakes

  • For cryptographic signing secrets, choose at least 32 hexadecimal characters (128 bits) or 64 hex characters (256 bits).
  • Because strings are created locally in memory and never sent over the network, nothing is logged on WebToolDock servers.
  • Avoid using generated strings in place of an established password manager’s vault when you need secure long-term storage.
Frequently Asked

Random String Generator – Frequently Asked Questions

Common questions, edge-cases, and mathematical explanations.

Why does this generator use rejection sampling with crypto.getRandomValues()?

Simply taking a random 32-bit integer modulo alphabet length introduces slight statistical bias when 2³² is not evenly divisible by the alphabet size. Rejection sampling discards out-of-range values so every character has an identical probability.

How long should a hexadecimal token be to reach 128-bit or 256-bit strength?

Each hex character carries 4 bits of entropy, so 32 hex characters provide 128 bits and 64 hex characters provide 256 bits.

Can I generate passwords with punctuation symbols?

Yes. Select “Letters, numbers, and symbols” under Characters and choose a length of at least 16–20 characters.

Analytics preferences

Optional Google Analytics cookies help us understand visits and improve our tools. Analytics is off until you allow it. Your tool inputs and files are never included in our analytics events. Read our privacy policy.

Analytics is off.