How-to Guide 5 min read

How to Roll Dice Online With a Random Number Generator (and the Odds)

Roll one or more dice online with a random number generator, flip a coin, and see the exact odds of every two-dice total, doubles and at least one six.

roll dice onlinevirtual dice roller2 dice probability chartdice roll random number 1 to 6flip a coin online

The short answer

To roll a die online, set a random number generator to a minimum of 1 and a maximum of 6 and generate one number. For two dice, generate two numbers with duplicates allowed and add them. The Random Number Generator has a 1-6 (Dice) preset and a Coin flip preset (0 or 1), and it uses your browser's cryptographic random source. With two dice, 7 is the most likely total (6 in 36, about 16.7%), while 2 and 12 are the least likely (1 in 36 each).

Step by step

One die

  • Open the Random Number Generator.
  • Under Quick presets, click 1-6 (Dice). This sets Minimum 1, Maximum 6 and one number.
  • Click Generate Random Numbers. The result appears in large type.
  • Click Regenerate for the next roll.
  • Several dice

  • Click 1-6 (Dice) to set the range.
  • Move the How many numbers? slider to the number of dice, for example 2 for Monopoly or 5 for Yahtzee-style games. It goes up to 100.
  • Leave No duplicate numbers unticked. Real dice can show the same face, so duplicates must be allowed.
  • Click Generate Random Numbers. Each die appears as a separate number. Add them yourself if the game uses the total.
  • Copy all copies the results, one per line, which is handy for keeping a record of rolls.

    Other dice

    Change the maximum for other dice used in board and role-playing games: 4, 8, 10, 12 or 20. For a d20, set Minimum 1 and Maximum 20. For a percentile roll, use 1 to 100.

    Coin flip

    Click Coin flip to set the range to 0 to 1, then generate. Decide before you click which number means heads (for example 1 = heads, 0 = tails).

    Why "no duplicates" is wrong for dice

    With No duplicate numbers ticked, the tool never repeats a value in one batch. That is right for raffles and lottery-style draws, but wrong for dice: two dice can both show 4. Ticking it also limits you to six results for a 1 to 6 range, because there are only six different faces. Keep it off for dice.

    Odds for two dice

    Two six-sided dice have 6 × 6 = 36 equally likely combinations. The totals are not equally likely, because some totals can be made in more ways. For example, 7 comes from 1+6, 2+5, 3+4, 4+3, 5+2 and 6+1.

    TotalWaysProbabilityApprox. %
    211/362.8%
    321/185.6%
    431/128.3%
    541/911.1%
    655/3613.9%
    761/616.7%
    855/3613.9%
    941/911.1%
    1031/128.3%
    1121/185.6%
    1211/362.8%

    These figures were worked out by listing all 36 combinations.

    Other useful odds

    • Doubles with two dice: 6 of 36 combinations, so 1 in 6 (16.7%).
    • At least one six with two dice: 1 − (5/6)² = 30.6%. People often guess 33% (one in three), but the chance of both dice showing six is counted only once.
    • At least one six with four dice: 1 − (5/6)⁴ = 51.8%, just better than even.
    • A specific face on one die: 1 in 6, every time. Previous rolls do not change it.
    • Three dice: 216 combinations. The most likely totals are 10 and 11, each with 27 ways (12.5%). The extremes, 3 and 18, have one way each (about 0.46%).

    Is an online dice roll fair?

    The tool fills an array with random values from crypto.getRandomValues, the browser's cryptographically secure random number generator, then maps each value into your range with the remainder after division. For a small range like 1 to 6, this mapping is not perfectly even in theory, but the difference is negligible: about 4 extra values out of more than 4.29 billion possible inputs. In practice every face is equally likely.

    For how browser random numbers work and why they are not "truly random" in the physical sense, see Is an Online Random Number Generator Truly Random?.

    Streaks are normal

    In a fair game, runs happen. If you roll 20 times, you will often see the same number twice or more in a row. Ten coin flips land on exactly five heads only about 24.6% of the time, so uneven results are the norm, not a sign of a broken generator.

    Practical uses

    • Board games when the dice are lost. One device can roll for everyone.
    • Teaching probability. Generate 100 rolls of a single die (set the count to 100), copy them into a spreadsheet, and count how often each face appears. With more rolls, the counts move closer to one sixth each.
    • Picking a random option. Number your choices and roll the matching range, for example 1 to 4 for four restaurants.
    • Role-playing games. Set the range for d4, d8, d10, d12 or d20 rolls.

    To pick several different winners from a list, such as raffle tickets, use the no-duplicates setting instead, as described in How to Pick Random Numbers Without Repeats for a Raffle.

    Common mistakes

    • Using 1 to 12 for two dice. A single random number from 1 to 12 makes every total equally likely and allows a total of 1, which two dice cannot produce. Generate two numbers from 1 to 6 and add them.
    • Leaving "No duplicate numbers" on from a previous raffle.
    • Assuming a number is "due". Each roll is independent. A six is not more likely because none has appeared for a while.
    • Rolling until you get the answer you want. Decide the rules, such as one roll only, before you click.

    Related tools

    To work out percentages from your experiment, the Percentage Calculator is quick. For averages and spread across many rolls, paste the results into the Statistics Calculator.

    Frequently asked questions

    How do I roll two dice online?

    Set the range to 1 to 6, set How many numbers to 2, leave No duplicate numbers unticked, and generate. Each number is one die; add them for the total.

    What is the most common total with two dice?

    7. It can be made 6 ways out of 36 (1+6, 2+5, 3+4, 4+3, 5+2, 6+1), a probability of 1 in 6 or about 16.7%.

    What are the odds of rolling doubles?

    With two six-sided dice, 6 of the 36 combinations are doubles, so the chance is 1 in 6, about 16.7%.

    Is an online dice roller fair?

    This one uses the browser's cryptographically secure random generator. Mapping values to 1 to 6 introduces a theoretical bias of only about 4 values in more than 4.29 billion, so each face is effectively equally likely.

    Try this tool on Lazyblink

    Put this guide into practice with our free online tool — no signup required.

    Open tool