Expected value calculator

List each outcome with its probability as x: p pairs. You get the expected value E[X], the variance, the standard deviation and E[X²]. Switch to weights if your numbers are counts rather than probabilities.

Pairs written x: p, separated by commas, semicolons or new lines. p can be 0.25, 1/4 or 25%. For example 0: 0.1, 1: 0.3, 2: 0.4, 3: 0.2.
Expected value E[X]1.7
Variance
0.81
Standard deviation
0.9
E[X²]
3.7
Sum of the probabilities or weights
1
Outcomes
4

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Type each outcome and its probability as x: p.
  2. Choose weights if you have counts instead of probabilities.
  3. Read E[X], the variance and the standard deviation.

How it works

E[X] = Σ x · p. The variance is computed as Σ p · (x − E[X])², which avoids the rounding loss of E[X²] − E[X]² when the mean is large. In weights mode each weight is divided by the sum of all weights.

Worked example

For 0: 0.1, 1: 0.3, 2: 0.4, 3: 0.2:

  • E[X] = 0.3 + 0.8 + 0.6 = 1.7
  • E[X²] = 0.3 + 1.6 + 1.8 = 3.7
  • Variance = 3.7 − 1.7² = 0.81, so the standard deviation is 0.9

A fair die (1 to 6, each 1/6) gives E[X] = 3.5 and variance 35/12 ≈ 2.9167.

Tips

  • Expected value is an average over many repetitions, not a prediction for one trial.
  • Outcomes with the same x value are fine; they are simply added together in effect.

Frequently asked questions

What is the expected value?

The long-run average of a random variable: E[X] = Σ x · p(x). It need not be a value the variable can actually take.

How is the variance calculated?

Var(X) = Σ p(x) · (x − E[X])², which equals E[X²] − E[X]². The standard deviation is its square root.

What if my probabilities do not add up to 1?

In probability mode the calculator reports the sum so you can fix the table. In weights mode it divides every weight by the total first.

How do I use it for a bet or a game?

Use the net gain or loss as x, for example 35 for a win and −1 for a loss, with the matching probabilities. A negative E[X] means a loss on average per play.

More in Math

All tools in this category: Math ·Updated November 3, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.