# Random Number Generator

> Draw one or thousands of random numbers between any two limits, with no repeats if you need them, decimals and sorting, or pick and shuffle items from your own list.

- Page: https://codethatmoves.com/tools/random/random-number-generator/
- Site: Code That Moves
- Category: Random and password generators
- Free, runs in the browser, nothing is uploaded
- Last checked: 2026-11-03

## What it does

- Random integers or decimals with up to 6 places between any two limits, both included
- 1 to 10 000 numbers at once, with an option for no repeats and sorting either way
- Pick one or more items from a list without repeats, or shuffle the whole list
- Presets for 1 to 10, 1 to 100, a die, two dice, a coin flip and a 6 of 49 lottery draw; dice show their total and coins read Heads or Tails
- Exclude numbers or ranges you never want drawn, such as 7, 13, 20-25
- The settings live in the page address, so a draw setup can be shared as a link, and a list of earlier draws stays on the page until you leave
- Fair draws: crypto.getRandomValues with rejection sampling, so every value is equally likely
- Copy the result separated by new lines, commas or spaces

## How to use it

1. Type the minimum and the maximum, how many numbers you want, and the decimal places. Both limits can come up.
2. Tick No repeats for a draw where each number may appear once, such as a raffle or a lottery, and pick an order if you want the result sorted. Add numbers to Never draw if some must be left out. Press Enter in any field to draw again.
3. To pick names or prizes, switch to Pick from a list, put one item per line and press Pick, or shuffle the whole list. Copy the result when you are done.

## What it checks and why

A fair random number generator gives every value in the range the same chance. Taking a random number and the remainder after dividing by the range size is the common shortcut, and it is slightly unfair: when the range does not divide the generator's range evenly, the low values come up a little more often. This tool throws away the values that would cause that and draws again (rejection sampling), so the draw is exactly uniform.

The random bits come from crypto.getRandomValues, the browser's cryptographically secure generator, not from Math.random. That matters when the result has a stake, like a giveaway winner or a password digit, because a secure generator cannot be predicted from earlier outputs.

No repeats works like drawing numbered balls from a bag. It uses a partial Fisher-Yates shuffle, which picks each remaining value with equal chance and needs memory only for the numbers drawn, so 6 unique numbers from a range of a billion is as quick as 6 from 49.

Decimals are handled as steps. With 2 places between 0 and 1 there are 101 possible values, 0.00 to 1.00, and each has the same chance. Ranges up to 9 quadrillion steps are accepted, the limit of whole numbers JavaScript can hold exactly.

## Specs and sources

- [MDN: Crypto.getRandomValues()](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues)
- [W3C Web Cryptography API: getRandomValues](https://www.w3.org/TR/WebCryptoAPI/#Crypto-method-getRandomValues)
- [MDN: Math.random() is not cryptographically secure](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)

## Limits

- The numbers are pseudo-random from a cryptographic generator seeded by the operating system, not from a physical source such as atmospheric noise. For games, draws and sampling there is no practical difference.
- There is no seed, so a draw cannot be repeated or audited later. For an official lottery or a draw that must be verified, use a process with a published seed or a witness.
- Earlier draws are listed only until you leave or reload the page. Copy the result or take a screenshot if you need a record.
- Up to 10 000 numbers per draw, and up to 6 decimal places.

## Questions

### How do I pick a random number between 1 and 10?

Press the 1 to 10 preset and then Generate. Both 1 and 10 can come up, and each of the ten numbers has the same chance of one in ten.

### Can I generate random numbers without repeats?

Yes. Tick No repeats and each number appears at most once, like balls drawn from a bag. You cannot ask for more numbers than the range holds.

### Is this random number generator truly random?

It uses the browser's cryptographically secure generator, which the operating system seeds with hardware randomness. It is not a physical noise source, but its output cannot be predicted and every value is equally likely.

### How do I pick a random name from a list?

Switch to Pick from a list, paste the names one per line, set how many winners you need and press Pick. With No repeats on, nobody is picked twice.

### Can I simulate dice or a coin flip?

Yes. Roll a die gives a number from 1 to 6, Two dice gives two of them with the total, and Flip a coin shows Heads or Tails. Set How many to flip several coins and see the count of each.

### Can I exclude certain numbers?

Yes. Type them in Never draw, separated by commas, with ranges written as 20-25. The remaining numbers keep equal chances.

### Why not use Math.random for a giveaway?

MDN notes that Math.random is not cryptographically secure, so its output can in principle be predicted. For anything with a prize or a stake, a secure source such as this one is the safer choice.
