Calculators

Random number generator 1 to 6

Use this page as a six-sided die. Select Generate numbers and it rolls one number from 1 to 6, each with a 1 in 6 chance, just like a fair die. Set How many numbers to roll several dice in one go, or select No repeats to shuffle 1 to 6. Every roll is made in your browser.

Settings

Choose your range and how many numbers to generate.

Random number options

Use whole numbers, such as -25. No commas or exponents. For values like 2.50, switch Number type to Decimals.

Decimal places applies in Decimals mode. Endpoints must fit the chosen precision; they are never rounded.

Each value appears at most once in this batch.

Choose your options, then generate numbers.

Your numbers

Your results will appear here, one number per line.

Both endpoints are included in the possible values. Decimals are sampled at your chosen step: 2 decimal places means steps of 0.01.

No repeats needs enough values in the range. With repeats allowed, a value can appear more than once.

Rolling a die with 1 to 6

The form starts at Minimum value 1, Maximum value 6 and How many numbers 1, with Number type on Integers. One click on Generate numbers is one roll of a standard die.

  1. Select Generate numbers to roll. The result appears under Your numbers.
  2. Select Generate again to roll again. The die has no memory, so any face can follow any other.
  3. For a game log, select Copy results, or save the rolls with Download .txt as random-numbers.txt.

Changing any setting clears the last roll, and Reset puts the form back on one roll from 1 to 6. To roll three dice, set How many numbers to 3; each line is one die. Unlike a physical die, the page cannot be thrown badly or land on an edge, and it will not favour a face because of a worn corner or uneven weight.

The odds of a six-sided die

Each face has a 1 in 6 chance on every roll, about 16.7%. Waiting for a 6 takes longer than people expect. The chance of at least one 6 in four rolls is 51.8%, just over half, and even in six rolls it is only 66.5%.

Rolling each face once takes about 14.7 rolls on average. Six rolls in a row that show six different faces happen only 1.54% of the time, so repeats within a handful of rolls are normal and say nothing about fairness.

In a check of 1,000,000 rolls through the real engine, each face came up between 166,483 and 166,887 times against an expected 166,667. The average roll was 3.499, next to the 3.5 of a fair die, and 16.63% of rolls matched the roll before. A face that has not appeared for a while is not due: every roll starts from the same 1 in 6.

Two dice and totals

Set How many numbers to 2 to roll two dice. The page lists the two rolls on separate lines and does not add them, so the total is up to you. Board games that use two dice care about that total.

Two dice give 36 equally likely pairs, and the totals are not equally likely. A total of 7 comes from six pairs, so it has a 6 in 36 chance, 16.7%. Totals of 6 and 8 each come from five pairs, 13.9%. A total of 2 needs a 1 on both dice, and 12 needs a 6 on both, so each has a 1 in 36 chance, about 2.8%.

For a single number from 2 to 12, do not change the range to 2 to 12. That range makes every total equally likely, 1 in 11 each, which is not how two dice behave. Roll two numbers from 1 to 6 and add them instead. The same goes for three or more dice.

How six faces stay equal

The generator takes random bytes from Web Crypto, the browser's cryptographic random source. Six values need 3 bits, so it keeps the lowest 3 bits of a byte, a value from 0 to 7. The values 0 to 5 become the faces 1 to 6, and a byte that gives 6 or 7 is discarded before the next byte is read.

Each face ends up with exactly 32 of the 256 possible byte values, and 64 byte values lead to a fresh try. Three bytes in four are kept, so a roll uses 1.33 bytes on average.

The common shortcut of dividing a byte by 6 and keeping the remainder would load the die slightly. 256 is 42 sixes plus 4, so faces 1 to 4 would own 43 byte values each, a 16.80% chance, while 5 and 6 would own 42, 16.41%. Discarding the extra values keeps all six faces at exactly one sixth.

Shuffling 1 to 6 with No repeats

Select No repeats and set How many numbers to 6 to get every face once, in random order, such as 4, 3, 1, 6, 5, 2. The generator draws without replacement: each face it picks is removed, and the next pick is even across the faces left.

There are 720 possible orders of six numbers, each with a chance of 1 in 720. In 60,000 such lists from the engine, all 720 orders appeared, on average 83 times each. Use the order for six players' turns, six stations in a lesson or six questions in a quiz.

With a smaller count, No repeats picks different faces: a count of 2 gives two different numbers, which a pair of real dice cannot promise. How many numbers can be at most 6 with No repeats. A count of 7 shows an error beside How many numbers, saying there are fewer available values than the requested count, and no numbers appear.

Limits

The page shows plain numbers. It draws no dice faces, plays no rolling animation and has no wheel. It rolls six-sided dice only in this setting; for other dice, change Maximum value, such as 20 for a twenty-sided die, and add totals yourself.

No history is kept. The page cannot stop a number from returning in a later roll, cannot replay an earlier roll and keeps no record that proves to other players that a roll was fair. Leaving the page clears the result.

How many numbers has no cap from the tool, so a thousand rolls work as well as one. Above 10,000 numbers, the box shows the first 10,000, and Copy results and Download .txt include every roll. The page needs JavaScript and Web Crypto; a browser without them sees a message instead of numbers.

Questions

What are some random numbers between 1 and 6?

Any of 1, 2, 3, 4, 5 and 6, with an equal 1 in 6 chance. For a set, type 10 into How many numbers and select Generate numbers; each line is a fresh roll, so repeats are expected. With No repeats and a count of 6, you get all six once in random order.

What are the 6 lucky numbers for today?

This generator has no lucky numbers. Every number from 1 to 6 has the same chance on every roll, and the page asks for no date or name, so it cannot work out personal luck. It can give you six numbers, though: set How many numbers to 6 and select Generate numbers.

Can I roll two dice at once?

Yes. Set How many numbers to 2 and select Generate numbers. The two rolls appear on separate lines, each an independent 1 to 6 roll, and you add them for the total. Leave No repeats off, because real dice can show the same face; No repeats would forbid doubles.

Is this the same as rolling a real die?

For the odds, yes: each face has exactly one sixth of the chance, from Web Crypto random bytes. A real die can be slightly uneven, while this one cannot. The page does not show a die, bounce or keep a roll history, and it works only while JavaScript runs in your browser.