Random Number Generator

Generate random integers or decimals. Single or multiple values, with optional duplicate prevention and sorting.

Result
Last 10 Generations
  • No generations yet

How to Use the Random Number Generator

Enter a minimum value and maximum value, choose how many numbers to generate (up to 100), then click Generate. The generator works in two modes: integer mode (default) and decimal mode. Toggle between them with the Decimal mode checkbox.

Integer Mode

In integer mode every result is a whole number in the range [Min, Max] inclusive. The default range is 1 to 100, which covers the most common use cases: dice-style games, random sampling, classroom exercises, and picking lottery numbers. To simulate a six-sided die set Min to 1 and Max to 6. To pick a random number from 0 to 999 set Min to 0 and Max to 999.

Decimal Mode

Decimal mode generates floating-point numbers uniformly distributed between Min and Max. Use the precision selector to control how many decimal places appear in each result. This is useful for simulations that need fractional values, generating random probabilities between 0 and 1, producing realistic-looking measurement data, and testing software that processes float inputs.

Multiple Values and No Duplicates

Set the Quantity field to any number between 1 and 100 to generate that many results in a single click. When the No duplicates option is checked each value in the output appears at most once — equivalent to drawing from a hat without replacement. This is commonly used for raffle draws, random seating arrangements, unique sample selection, and any scenario where repetition is not allowed. Note that for integers, the maximum number of unique values is bounded by the size of the range (Max − Min + 1). If you request more unique values than the range can provide, the generator returns as many unique values as possible.

Sorting Results

Check Sort results to display numbers in ascending order. Sorted output makes it easier to spot patterns, check coverage of a range, or present results in a list. For decimal mode results are sorted numerically regardless of the number of decimal places shown.

Copying and Sharing

After generating numbers, use Copy numbers to copy a space-separated list to the clipboard, or Copy as CSV to get a comma-separated string you can paste directly into a spreadsheet. The Share these settings URL encodes your Min, Max, Quantity, and mode choices so you can send the same configuration to a colleague or bookmark it for later.

Generation History

The last 10 generations are stored in your browser session and displayed below the main calculator. Each history entry shows the generated numbers, the range used, and the time of generation. History is not saved to any server and disappears when you close or refresh the page.

PRNGs vs True Random Numbers

Most random number generators on the web, including this one, use a pseudo-random number generator (PRNG). A PRNG uses a mathematical formula seeded with an initial value (usually the current timestamp in milliseconds) to produce a sequence of numbers that appears random. The sequence is statistically uniform — over millions of draws each value in the range appears with roughly equal frequency — but it is technically deterministic: given the same seed, the same sequence is produced every time.

For everyday tasks like games, sampling, teaching, and simulations, PRNGs are more than adequate. For cryptographic applications — generating session tokens, passwords, or encryption keys — the Web Crypto API's crypto.getRandomValues() provides a cryptographically secure source of randomness. This tool uses Math.random() from the browser's JavaScript engine, which is appropriate for all non-security-critical uses.

True hardware random number generators (TRNGs) collect entropy from physical phenomena such as thermal noise or radioactive decay. Services like random.org use atmospheric noise. Unless you need cryptographic strength randomness, a well-implemented PRNG is equivalent for practical purposes.

Common Uses for Random Number Generators

Random number generators appear in a surprisingly wide range of contexts. In board games and tabletop RPGs they simulate dice rolls and loot tables. In statistics and research they are used for random sampling, bootstrapping, and Monte Carlo simulations. In education teachers use them to call on students randomly or assign groups. In software development random values are used to seed test data, stress-test edge cases, and generate placeholder content. In lotteries and prize draws they ensure fairness by removing human selection bias.

FAQ

This generator uses your browser's Math.random() function, which is a pseudo-random number generator (PRNG). It produces statistically random-looking numbers suitable for games, sampling, and everyday use, but is not cryptographically secure. For security-critical purposes such as passwords or cryptographic keys, use a dedicated tool backed by the Web Crypto API.
When "No duplicates" is enabled, each generated number appears at most once in the results. This is equivalent to drawing from a pool without replacement — like a lottery draw. If you request more unique integers than the range contains (for example, 20 unique numbers between 1 and 10), the generator returns as many as possible and displays a note that the range was exhausted.
You can generate up to 100 numbers in a single generation. This limit keeps results readable and prevents browser slowdown. For very large datasets, generate multiple batches and combine the results using the Copy as CSV option.
In decimal mode the generator produces a floating-point number uniformly distributed between your minimum and maximum values. You control the number of decimal places shown (1 through 10). For example, with Min 0, Max 1, and 4 decimal places you might get values like 0.3847 or 0.9102.
A pseudo-random number generator (PRNG) uses a deterministic algorithm seeded with an initial value (often the current time) to produce a sequence of numbers that passes statistical randomness tests. Although the sequence is technically predictable given the seed, modern PRNGs like those in browsers are more than adequate for simulations, games, sampling, and educational purposes.