Skip to content

Random Number Generator

Pick a random integer in any range — 1 to 10, 1 to 1,000,000, or any custom min/max including negatives. Cryptographically secure, inclusive, history of last 10 results.

Runs entirely in your browser — no data is sent to any server.

About this tool

This generator produces a single random integer between any two values you choose. Set the minimum and maximum, press "Generate," and receive a result. The range is fully inclusive — both the minimum and maximum values can appear. Every integer in the range has an exactly equal probability of being selected.

The randomness source is crypto.getRandomValues, the Web Cryptography API's secure random source. It draws entropy from your operating system rather than from a deterministic seed, making results cryptographically unpredictable. The last 10 results are shown in a history panel so you can track the current session's output.

How it works

When you press "Generate," the tool calls crypto.getRandomValues() to fill a typed array with cryptographically random bytes. It then uses a rejection-sampling algorithm to convert those bytes into an integer within your requested range without introducing any statistical bias.

Naive approaches — like Math.floor(Math.random() * (max - min + 1)) + min — can introduce subtle bias when the range doesn't divide evenly into the generator's output space. Rejection sampling eliminates this: values that would cause bias are discarded, and the process repeats until an unbiased value is found. For full technical details, see our randomness methodology.

Common uses

Games and decision-making. Any situation that needs a fair random number: determining turn order, randomizing map features, picking a number for a guessing game, drawing a raffle winner by seat number. The adjustable range means you don't need a specific die size.

Statistics and sampling. Teachers and researchers use random number generators to select random samples from numbered lists. If you have 200 survey responses and need to sample 20 for qualitative review, generate 20 non-repeating random numbers between 1 and 200.

Lottery picks. Most lottery formats require numbers within specific ranges. Set the range to match your lottery's rules and generate each number in your pick. The cryptographically secure source means no deterministic pattern can be inferred from your picks.

Classroom activities. Random number generators are used in probability lessons, classroom quizzes (which student is called on next), and simulation exercises. Setting a range of 1–6 emulates a die; 1–2 emulates a coin flip.

Software testing. Developers use random number generators to produce test data — user IDs, port numbers, offset values, random delays. The cryptographic source gives higher-quality entropy than typical test fixtures.

All randomization on Spinness uses crypto.getRandomValues() — the browser's cryptographic random source. Learn how our randomness works.

Frequently asked questions

What range of numbers does this generator support?

The generator supports any range up to one billion numbers wide. You can set the minimum and maximum to any integers — including negative numbers. For example, a range of -50 to 50 or 1 to 1,000,000 both work. The generator uses cryptographically secure randomness, so every integer in the range has an exactly equal probability of being selected.

Is this truly random, not pseudorandom?

Yes. This tool uses crypto.getRandomValues, which is the Web Cryptography API's secure random source. It seeds from your operating system's entropy pool — hardware events, thermal noise, and network timing — rather than from a deterministic algorithm. This is the same source used for SSL/TLS encryption and is computationally infeasible to predict, unlike Math.random().

Can I generate multiple random numbers at once?

The current version generates one number per press. For multiple numbers, press "Generate" repeatedly — the last 10 results are shown in the history panel below the main result. If you need a batch of numbers at once, the tool will be updated with a multi-result mode in a future release.

Does it include both the minimum and maximum?

Yes. The range is fully inclusive on both ends. If you set min to 1 and max to 10, every number from 1 through 10 has an equal 10% chance of appearing. This matches the intuitive expectation — "a number between 1 and 10" includes both 1 and 10.

What is the difference between this and rolling dice?

A standard six-sided die generates a number from 1 to 6. This generator is a generalization of that concept — you choose any range, not just 1–6. Rolling 2d10 (two ten-sided dice) with a range of 2–20 would add two random 1–10 rolls; this generator picks from the full range in a single draw. For dice-specific mechanics (sum of multiple dice, advantage/disadvantage), a dedicated dice roller is more appropriate.

Can I use this for lottery numbers?

Yes, you can use it to generate lottery number picks. Set the range to match your lottery format — for example, 1 to 70 for the Mega Millions white ball pool, then 1 to 25 for the Mega Ball. Run the generator for each number in your pick. This tool does not guarantee any lottery outcome; it simply provides a random number within the range you specify.

Is my data private?

Yes. All randomization runs entirely in your browser — no names, inputs, or results are sent to any server. Spinness has no backend. Your data never leaves your device.

How is the randomness generated?

This tool uses crypto.getRandomValues() — the browser's cryptographic random source, not Math.random(). Every result is statistically unpredictable. See our Methodology page for the full technical explanation.