# Probability Simulator - Coin Flips, Dice Sums, Spinners and Urn Draws Online

> Free online probability simulator: coin flips, d4-d20 dice, weighted spinners and urn draws over a million trials, with live histograms and a chi-square test.

- URL: https://qilingtools.com/en/math/dice
- Category: Math Tools (https://qilingtools.com/en/math)
- Tags: [Math](https://qilingtools.com/en/tags/math), [Statistics](https://qilingtools.com/en/tags/statistics), [Kids](https://qilingtools.com/en/tags/kids), [Fun & Games](https://qilingtools.com/en/tags/game)
- Last updated: 2026-10-26
- Price: Free, no sign-up
- Privacy: Runs locally in the browser; files are never uploaded

Textbooks say that the more trials you run, the closer the frequency gets to the probability — here you can watch it happen. Pick a random experiment (coins, dice, a spinner or an urn), choose how many trials to run and press start. The bars show the observed frequencies, the red dots the exactly computed probabilities, the line chart shows the running average settling down to the expected value, and a chi-square test tells you whether the results fit the theory. For a single quick dice roll the random number generator is handier; this tool is for many repeated trials and their statistics.

## How to use

1. Choose an experiment — coins, dice, spinner or urn — and set its parameters
2. Pick the number of trials (10 to 1,000,000) and the animation speed; add a seed if you want a reproducible run
3. Press “Run simulation” and watch the histogram and running average; pause and resume at any time
4. Compare the sample mean and variance with theory and read the chi-square p-value

## Features

- Four classic experiments: coins (any number, adjustable bias), the sum of N d4/d6/d8/d10/d12/d20 dice, a weighted spinner and red/blue balls drawn with or without replacement
- Exact theoretical distributions: convolution for dice sums, binomial for coins and draws with replacement, hypergeometric without replacement
- Frequency histogram overlaid on the theoretical probabilities, plus a table of counts, frequencies and probabilities
- Law of large numbers chart: the running average (or a sector’s running frequency) converging to its expected value, on a log axis for long runs
- Chi-square goodness-of-fit test with χ², degrees of freedom and p-value; bins with expected counts below 5 are merged
- Slow mode animates every single roll, while instant mode finishes a million trials in under a second
- Uses the browser’s cryptographic RNG by default; enter a seed to make a classroom demo exactly repeatable

## FAQ

### What is the law of large numbers and where do I see it here?

It says that as the number of independent trials grows, the relative frequency of an event approaches its probability and the sample mean approaches the expected value. Watch the running-average chart: it swings wildly at first, and after a few thousand trials it hugs the dashed red line of the theoretical mean.

### Why is 7 the most likely sum of two dice?

Two dice have 36 equally likely outcomes and 7 can be made in the most ways — (1,6), (2,5), (3,4), (4,3), (5,2), (6,1) — so its probability is 6/36 = 1/6, while 2 and 12 have just one way each. With more dice the distribution of the sum looks more and more like a normal bell curve.

### How should I read the chi-square p-value?

The p-value is the chance of seeing a deviation at least this large if the dice (or coin) really are fair. p ≥ 0.05 is usually taken as consistent with theory and p < 0.05 as a significant difference. Even with perfectly fair randomness you will get p < 0.05 about 5% of the time.

### What changes between drawing with and without replacement?

With replacement every ball goes back before the next draw, so the chance of red never changes and the number of reds is binomial. Without replacement the mix changes after each draw, the count follows the hypergeometric distribution and its variance is smaller. You can compare both settings side by side.

## Related tools

- [Graphing Calculator](https://qilingtools.com/en/math/graph): Free online function graphing calculator: type sin(x), x^2 or 1/x and see the curve at once, with several functions, parametric and polar curves, PNG export.
- [Scientific Calculator](https://qilingtools.com/en/math/calculator): Free online scientific calculator: type 2*(3+4)^2, sin(pi/6) or log(8,2) and see the answer as you type, with degrees or radians and a history list.
- [Equation Solver](https://qilingtools.com/en/math/equation): Free online equation solver: enter coefficients for linear, quadratic (with discriminant, vertex and complex roots) and cubic equations, plus 2×2 systems.
- [Fraction Calculator](https://qilingtools.com/en/math/fraction): Free online fraction calculator: add, subtract, multiply and divide fractions with automatic reduction, plus fraction ↔ decimal with repeating digits.
- [Percentage Calculator](https://qilingtools.com/en/math/percentage): Free online percentage calculator: X% of Y, X as a percent of Y, increase and decrease, a value after a percentage change and the original behind it.
- [Prime Factorization](https://qilingtools.com/en/math/prime): Free online prime factorization: factor an integer with exponents, list every divisor and their sum, test primality with neighbouring primes, or list a range.
- [GCD and LCM](https://qilingtools.com/en/math/gcd-lcm): Free online GCD and LCM calculator: works with two or more integers, says whether they are coprime, shows each prime factorization and every Euclidean step.
- [Statistics Calculator](https://qilingtools.com/en/math/statistics): Free online statistics calculator: paste a data set for the mean, median, mode, range, quartiles, variance, standard deviation, standard error and outliers.
