Random Number Generator
Generate a random number in any range — integers or decimals, with optional no-repeat mode. Useful for picking lottery numbers, random sampling, and game mechanics.
How to use the random number generator
Pick a min, max, and count. Toggle 'unique' to disallow repeats.
Formula & explanation
Numbers come from window.crypto.getRandomValues — a CSPRNG, not Math.random — so they're suitable even for sensitive uses.
Examples
Pick 6 unique numbers between 1 and 49 for lottery; pick 100 numbers between 0 and 9 for a sample.
Frequently asked questions
- Is this truly random or pseudorandom?
- The generator uses window.crypto.getRandomValues, a cryptographically secure pseudorandom number generator (CSPRNG) built into modern browsers. It is statistically indistinguishable from true randomness for all practical purposes.
- Can I use this for lottery picks?
- Yes. Enable the 'Unique' checkbox, set Min and Max to your lottery range (e.g. 1–49), set Count to the number of balls drawn, and click Generate.
- What does 'Unique' do?
- When checked, no number appears more than once in the result set. The range (Max − Min + 1) must be at least as large as Count, otherwise no results are returned.
- Why is Math.random not used here?
- Math.random is a fast but non-cryptographic PRNG whose output can sometimes be predicted. crypto.getRandomValues is unpredictable and suitable for security-sensitive applications like token generation or fair draws.
Related generators tools
- Random Color GeneratorGenerate a random color or a harmonious palette using complementary, triadic, or analogous color rules. Shows HEX, RGB, and HSL values — great for design inspiration.
- Random Name GeneratorGenerate random first and last names from many cultures and regions — English, Spanish, Japanese, Chinese, and more. Useful for placeholders, test data, and creative writing.
- Password GeneratorGenerate strong, random passwords with custom length, uppercase, lowercase, numbers, and symbols. Built-in strength meter. Nothing is stored — all generation happens in your browser.
- UUID GeneratorGenerate random UUID v4 strings instantly — one or in bulk. Copy-paste ready GUIDs for databases, APIs, and unique identifiers.
- Barcode GeneratorGenerate EAN-13, EAN-8, UPC-A, Code 128, and Code 39 barcodes from any input. Download as SVG or PNG — useful for product labeling, inventory, and retail applications.
- QR Code GeneratorCreate QR codes for URLs, plain text, phone numbers, or contact cards (vCard). Download as PNG. Free QR code generator — no signup, no watermark, works in your browser.