Random Number Generator, Pick a Number in Any Range

Generate a random number between any two values instantly. Unbiased results for

,
Tap to generate

Random Number Generator

Generate a random integer between any minimum and maximum value with this free online number generator. Set your range, 1 to 10, 1 to 100, 1 to a million, and click to get an unbiased random result instantly. Each number in your specified range has an exactly equal probability of being selected, powered by the browser\'s cryptographic random source. The tool is designed for speed: enter your bounds, click, and the result appears immediately with a smooth pop animation. A session history tracks your recent generations so you can review past numbers without writing them down. This is useful when you need several random numbers in sequence, for lottery number picks, statistical sampling, or game scoring. Common uses include generating lottery numbers, picking raffle winners by number, creating random test data, assigning numbered tasks, and running probability experiments. The range is flexible enough for any scenario, from rolling a simulated 100-sided die to picking a random page number from a 500-page book.

How it works

The generator uses the formula Math.floor(Math.random() * (max - min + 1)) + min to produce a uniformly distributed random integer within your specified range (inclusive of both endpoints). Math.random() returns a floating-point value between 0 (inclusive) and 1 (exclusive), seeded by the browser\'s cryptographic entropy pool. Multiplying by the range width and flooring ensures every integer in the range has equal probability. If you enter the min higher than the max, the tool automatically swaps them. Results are pushed to a history array displayed as clickable chips below the generator.

When to use this tool

Lottery players use it to pick ticket numbers without personal bias. Teachers assign random seat numbers or group identifiers to students. Software developers generate test IDs and mock data during development. Board gamers simulate dice of any size, need a d100? Set the range to 1-100. Researchers perform random sampling by generating indices into a dataset. Raffle organizers assign numbers to participants and then generate the winning number publicly.

Frequently asked questions

Is every number in my range equally likely?

Yes. The algorithm produces a uniform distribution where each integer has a probability of exactly 1/(max - min + 1). For a range of 1 to 100, every number has a 1% chance.

Can I generate negative numbers?

Yes. Set the minimum to a negative value (e.g., min = -50, max = 50). The generator works with any integer range, including all-negative ranges like -100 to -1.

What is the largest range I can use?

JavaScript\'s Math.random() produces a 64-bit float, so ranges up to about 9 quadrillion are theoretically possible. In practice, ranges up to several billion work perfectly. For everyday use (1 to 1,000,000), the results are impeccable.

Can I generate decimals instead of integers?

This tool generates whole numbers only. For decimal values, try the random string generator in numeric mode, or use the number generator with a larger range and divide mentally (e.g., generate 1-1000 and divide by 10 for one decimal place).

How do I generate multiple random numbers at once?

Click the generate button repeatedly, each result is logged in the history panel below the generator. You can generate as many numbers as you need, and the history keeps the last 20 results visible.

Related tools

Dice Roller for d4, d6, d8, d10, d12, d20

Random Letter generator A to Z

Random String for alphanumeric output

Coin Flip for simple binary random